You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As defined in the following issues, we want to reformat the JSON response from our API to match the standard laid out by JSONAPI (with the exception of keeping objects inline).
The JSON response provided by our API is currently a slightly modified version of the JSON format provided by bookshelf when calling its toJSON method.
Once we have duplicated the old api so that the admin UI remains stable on master (#2543), we can then create a new version of the toJSON method i.e. the toJSONAPIJSON method, that will be used by the new API to provide JSON objects in the JSONAPI format.
This will mean placing relations into link objects instead of inlining them as the existing API does. It will also mean moving additional properties such as pagination data into meta objects.
This issue covers the creation of a new base method for producing JSON from bookshelf objects and the associated unit tests. It doesn't cover ensuring that it gets used in the right places (which would require functional/integration tests). That will be done in other issues (will add links once they are created).
The text was updated successfully, but these errors were encountered:
When we decide to implement an option which switches the API into linked object / strict JSON API mode, we will need to do this (provide a different version of toJSON).
In the meantime, we need to make much less hardcore changes, and I don't think we need to tweak toJSON anymore. I think we can make much smaller incremental changes to individual bits of the API, as described here: #2346 (comment)
As defined in the following issues, we want to reformat the JSON response from our API to match the standard laid out by JSONAPI (with the exception of keeping objects inline).
The JSON response provided by our API is currently a slightly modified version of the JSON format provided by bookshelf when calling its
toJSON
method.Once we have duplicated the old api so that the admin UI remains stable on master (#2543), we can then create a new version of the
toJSON
method i.e. thetoJSONAPIJSON
method, that will be used by the new API to provide JSON objects in the JSONAPI format.This will mean placing relations into
link
objects instead of inlining them as the existing API does. It will also mean moving additional properties such as pagination data into meta objects.This issue covers the creation of a new base method for producing JSON from bookshelf objects and the associated unit tests. It doesn't cover ensuring that it gets used in the right places (which would require functional/integration tests). That will be done in other issues (will add links once they are created).
The text was updated successfully, but these errors were encountered: