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

error helper doesn't let you send multiple errors #16

Open
sergiofenoll opened this issue Oct 18, 2023 · 0 comments
Open

error helper doesn't let you send multiple errors #16

sergiofenoll opened this issue Oct 18, 2023 · 0 comments

Comments

@sergiofenoll
Copy link

The JSON:API specification states that servers may continue processing after encountering an error. In a case that we encounter multiple errors, we probably want to return multiple error objects to the client to inform them about all the different errors.

Currently the error helper doesn't allow that, as it always returns a Flask Response object which is AFAIK not meant to be further mutated, especially it's body. If a user of the template wants to send multiple errors in one response they will have to craft the response themselves.

Would it make sense to add a new helper (so as to not create a breaking change in the template) called errors that lets users create responses containing multiple errors? Alternatively the behaviour of the error helper could be changed to only generate an error object (per the JSON:API spec) and have users generate the response themselves, but this would be a breaking change.

@sergiofenoll sergiofenoll changed the title error helpers doesn't let you send multiple errors error helper doesn't let you send multiple errors Nov 27, 2023
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

No branches or pull requests

1 participant