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
Is your feature request related to a problem? Please describe.
As of openapi-generator 7.11.0 (#19577, #19578), a jackson @JsonCreator constructor is generated for models with required properties.
When deserializing a payload that is missing required properties, jackson throws a MismatchedInputException.
This means that part of the input validation concerns, which are typically handled by Bean Validation, are now done by jackson instead.
This is not always desirable:
Frameworks may translate Bean Validation errors to a proper HTTP 400 Bad Request, while that is not necessarily done for Jackson MismatchedInputException. It is also difficult to distinguish such MismatchedInputException caused by inbound request (should map to HTTP 400) to one caused by an inbound respons (should map to HTTP 500) in a generic way.
There's also a regression causing incorrect validation errors for required properties in oneOf (#20545).
Describe the solution you'd like
A config option "generateJsonCreator" (default true) which can be set to false to disable the generation of the @JsonCreator constructor with required properties.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
As of openapi-generator 7.11.0 (#19577, #19578), a jackson @JsonCreator constructor is generated for models with required properties.
When deserializing a payload that is missing required properties, jackson throws a MismatchedInputException.
This means that part of the input validation concerns, which are typically handled by Bean Validation, are now done by jackson instead.
This is not always desirable:
Frameworks may translate Bean Validation errors to a proper HTTP 400 Bad Request, while that is not necessarily done for Jackson MismatchedInputException. It is also difficult to distinguish such MismatchedInputException caused by inbound request (should map to HTTP 400) to one caused by an inbound respons (should map to HTTP 500) in a generic way.
There's also a regression causing incorrect validation errors for required properties in oneOf (#20545).
Describe the solution you'd like
A config option "generateJsonCreator" (default true) which can be set to false to disable the generation of the @JsonCreator constructor with required properties.
The text was updated successfully, but these errors were encountered: