We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The idea is to allow different JSON formats which can be used with different REST clients.
The default format is:
{ "success":true, "status":"OK", "rows":[ { "roi":0, "cells":{ "birthday":"1982-12-13", "name":"foo", "id":0, "lastupdate":"2020-05-08T21:17:21.993+02:00", "credit":32.50, "age":30 } } ], "resource":"users", "pagination":{ "page":1, "size":6, "pages":1, "total":6 } }
To allow this, we can either use:
The format data would look like:
{ "formats": [ { "resource": "users", "meta": { "success": true, "status": false, "pagination": true }, "model": { "id": "number", "name": "string", "birthday": "dd/MM/yyyy", "credit": "number" } },{ "resource": "cars", "meta": null, "model": { "id": "number", "maker": "string", "lastUpdate": "ddMMyyyyhhmmss" } } ] }
A response from users then would be formatted as:
users
{ "success":true, "pagination":{ "page":1, "size":6, "pages":1, "total":6 }, "entities": [ { "id":0, "name":"foo", "birthday":"13/12/1982", "credit":32.50 } ] }
And a response from cars (with no metadata) would look like:
cars
{ "id":0, "maker":"foo", "lastUpdate":"13121982040130" }
The text was updated successfully, but these errors were encountered:
It might be also be possible to set "meta": "head" so the pagination is received as HTTP headers.
"meta": "head"
Sorry, something went wrong.
Eldelshell
No branches or pull requests
The idea is to allow different JSON formats which can be used with different REST clients.
The default format is:
To allow this, we can either use:
The format data would look like:
A response from
users
then would be formatted as:And a response from
cars
(with no metadata) would look like:The text was updated successfully, but these errors were encountered: