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
When using a jaxarta.validation.constraints.* annotation, a user can specify a 'groups' field on the annotation which causes that validation to only be applied if the validator has been configured to apply that group. If no groups are specified on the annotation then the annotation is applied for all inputs. springdoc-openapi is currently not checking for the presence of groups so it setting the limits from the validation globally, even where the validation would not apply to some requests.
To Reproduce
With an endpoint and model definition of
Expected behavior
Given no groups are known to be active, any validation that has groups specified should be presumed to be inactive and therefore not be applied to the model, e.g.
The same applies for other annotations, e.g.@Min, @Max, @Pattern etc.
Ideally, it would be useful to be able to configure the generator to have a set of group combinations to match to, defaulting to the 'empty' group to ensure validations that are applied to all requests are the only ones specified in the request
The text was updated successfully, but these errors were encountered:
Describe the bug
When using a jaxarta.validation.constraints.* annotation, a user can specify a 'groups' field on the annotation which causes that validation to only be applied if the validator has been configured to apply that group. If no groups are specified on the annotation then the annotation is applied for all inputs. springdoc-openapi is currently not checking for the presence of groups so it setting the limits from the validation globally, even where the validation would not apply to some requests.
To Reproduce
With an endpoint and model definition of
the project currently generates a JSON definition with the following parameters
Expected behavior
Given no groups are known to be active, any validation that has groups specified should be presumed to be inactive and therefore not be applied to the model, e.g.
The same applies for other annotations, e.g.
@Min
,@Max
,@Pattern
etc.Ideally, it would be useful to be able to configure the generator to have a set of group combinations to match to, defaulting to the 'empty' group to ensure validations that are applied to all requests are the only ones specified in the request
The text was updated successfully, but these errors were encountered: