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
Description
When multiple validationContext are used on the same property, the Swagger documentation is incorrectly generated; it utilizes the same Assert regardless of the validationContext .
The validation works correctly during the API call, it's just the Swagger documentation generation that is incorrect.
indeed serialization groups are handled but validation not, feel free to patch that looking at how we did with serialization groups (in the schema factory).
I was able to work on a solution, but I'm not completely satisfied with what I'm proposing, and I think there's a cleaner way to achieve this.
I modified the way $definitionName is generated; I concatenated it with the validation groups (in addition to the serialization groups). Using the code example above, definitions look like this :
API Platform version(s) affected: 3.2.13
Description
When multiple
validationContext
are used on the same property, the Swagger documentation is incorrectly generated; it utilizes the sameAssert
regardless of thevalidationContext
.The validation works correctly during the API call, it's just the Swagger documentation generation that is incorrect.
How to reproduce
Using Validation documentation :
Here is the generated documentation for the 'author' property for both the POST and PUT methods:
The text was updated successfully, but these errors were encountered: