Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.2k
hint for mapping request payload error messages#19121
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Target 5.4 I guess? |
format. This will make the error handling output a JSON response in case of | ||
validation errors, rather than an HTML page:: | ||
#[Route('/dashboard', name: 'dashboard', format: 'json')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
the build fails on this. should we make it a different type of code block or do we need to add php code to make the ci happy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We can ignore it
Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
i found the place to reference the format option and linked it.
this hint is about if there is documentation about working with the error handler in general, it would make sense to add it there. buthttps://symfony.com/components/ErrorHandler is empty. https://symfony.com/doc/current/controller/error_pages.html#overriding-error-output-for-non-html-formats talks about custom normalizers - maybe somewhere in that chapter a hint would make sense. |
Thank you David. |
The information is particularly important in the context of the
MapRequestPayload
but technically not related. It is about the behaviour of the symfony error handler. If there is more documentation about the error handler and output formats, i am happy to link to that if you point me to the right place.I think it is valuable to mention this here though, as it will happen when using the feature. I almost gave up and set up some custom exception listener or whatnot to output json. Stackoverflow is full of answers proposing those to output errors as JSON.