Skip to content
New issue

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

Enhancement/enforce jsonapi compliant response format #32

Merged

Conversation

EmCousin
Copy link
Owner

This Pull Request introduces a couple of changes in the way the response is rendered in the following cases :

  • When the rendered object is not serializable or is an empty collection, it is not longer returned directly, but nested inside a JSONAPI compliant object

Before :

response = []
render response, meta: { page: 1 }
# => "[]"

After :

response = []
render response, meta: { page: 1 }
# => {\"data\":[],\"meta\":{\"page\":1}}"

Fixes #31

@EmCousin EmCousin self-assigned this Jan 24, 2022
@EmCousin EmCousin merged commit fa81e85 into master Jan 25, 2022
@EmCousin EmCousin deleted the enhancement/enforce-JSONAPI-compliant-response-format branch January 25, 2022 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Question: using render method for empty data
1 participant