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
An API returns an marshmallow.Schema object or a list of dictionaries as usually to jsonify parameter like:
from marshmallow import Schema schema.dump(query.items, many=True) jsonify(result)
Create a output:
[ { "id": 1, "name": "Avengers", "pub_date": "2020-01-20" }, { "id": 3, "name": "Iron Man 2", "pub_date": "2010-05-02" } ]
But the standard jsonapi say that the response MUST be like:
{ "links": { "self": "http://example.com/articles", "next": "http://example.com/articles?page[offset]=2", "last": "http://example.com/articles?page[offset]=10" }, "data": [{ "id": 1, "name": "Avengers", "pub_date": "2020-01-20" }, { "id": 3, "name": "Iron Man 2", "pub_date": "2010-05-02" } ]} }
Create a wrapper over jsonfy to accept a SQLAlchemy paginated instance and a list of elements and create this JSON object?
An example of lask-rest-api: https://github.com/Nobatek/flask-rest-api/blob/master/flask_rest_api/pagination.py
The text was updated successfully, but these errors were encountered:
No branches or pull requests
An API returns an marshmallow.Schema object or a list of dictionaries as usually to jsonify parameter like:
Create a output:
But the standard jsonapi say that the response MUST be like:
Create a wrapper over jsonfy to accept a SQLAlchemy paginated instance and a list of elements and create this JSON object?
An example of lask-rest-api:
https://github.com/Nobatek/flask-rest-api/blob/master/flask_rest_api/pagination.py
The text was updated successfully, but these errors were encountered: