cancel
Showing results for 
Search instead for 
Did you mean: 

Make API jsonapi compliant

0 Kudos

Make API jsonapi compliant

Feature request from owenhaynes, posted on GitHub Oct 25, 2015

At the moment the json API is not very compliant to http://jsonapi.org.

This makes life hard when trying to use the magento API with angluarjs modules such as rectangular, angualr-restmod.

I can imagine this is a lot of work.

7 Comments
New Member
Status changed to: Investigating
 
New Member

Comment from antonkril, posted on GitHub Oct 25, 2015

JSON api stable version was not released when we introduced APIs. Also usage of jsonapi might get to conflict with idea that service contracts should be represented the same way in php and through webapi.

But we will definitely look at this idea.

New Member

Comment from owenhaynes, posted on GitHub Oct 25, 2015

its just making it extremely difficult to work with angularjs with rest frameworks, one example is the GET /V1/guest-carts/{cartId}/items POST /V1/guest-carts/items PUT /V1/guest-carts/items/{itemId} DELETE /V1/guest-carts/{cartId}/items/{itemId}

the POST and PUT endpoints should in theory match DELETE and GET as you are modifying a cart, angualr-restmod expects this to be the case.

The cart call to create a cart POST /V1/guest-carts also cases issues as it does not return an object, thinking of writing a patch for this but no idea how much stuff would break.

At this rate going to have to write a wrapper around the API to format the endpoints to be more compliant.

New Member

Comment from irenelagno, posted on GitHub Oct 26, 2015

Internal ticket MAGETWO-44589 has been created.

New Member

Comment from choukalos, posted on GitHub Oct 26, 2015

This looks like partially a bug ( Cart APIs - we would like our API's to be easily used by node based platform i.e. Angular with out a wrapper ) and a feature request ( be compliant with json api standard which includes definitions on response payload structure). We'll look into the later portion as part of our future work to improve the web API framework

New Member

Comment from antonkril, posted on GitHub Oct 26, 2015

Just to clarify: internal ticket reported by @irenelagno is to fix naming of resources, not full support of jsonapi

New Member

Comment from sidolov, posted on GitHub Nov 02, 2015

Fixed naming of resources for cart items management. Delivered in cd0808932965b6bfd77599bafebb297803f0be97