-
-
Notifications
You must be signed in to change notification settings - Fork 892
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
ErrorResource missing title and details in JSON+LD response #6926
Comments
So for some context, I have the LoginRequest entity and I throw the error above in LoginRequestStateProcessor. This seems to happen when I have a group applied on the normalizationContext of LoginRequest for this operation. If I remove the serialization group, all properties get returned. Is it expected behavior that the serialization group should affect the entity's errors as well? |
Mhh interesting groups are set there: https://github.com/api-platform/core/blob/main/src/Symfony/EventListener/ErrorListener.php#L110 But they should not inherit from your original resource groups, would you be able to create a reproducer? You can also check inside the |
I have created a basic reproduction here. I'm not really sure whether I should reset the groups myself in the processor or if this should happen on its own. I am not overriding the ErrorListener, so that logic should still happen, right? Thanks! To reproduce, one needs to run the following:
Commenting out the groups from LoginRequest returns the whole error object. |
API Platform version(s) affected: 4.0.16
Description
I have created this ErrorResource class.
When throwing this error, i would expect the response to contain the title and details. Instead, the response looks as such. The title and detail fields are missing.
The text was updated successfully, but these errors were encountered: