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
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.
The text was updated successfully, but these errors were encountered:
sergiofenoll
changed the title
error helpers doesn't let you send multiple errorserror helper doesn't let you send multiple errors
Nov 27, 2023
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 FlaskResponse
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 theerror
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.The text was updated successfully, but these errors were encountered: