Jackson is ignoring the type validations for the offsetdatetime objects. #228
Replies: 1 comment
-
Ok, first things first: Jackson does not use OpenApi so you are probably not using Jackson: you might be using something that uses Jackson annotations, but if so, there's nothing Jackson can do wrt applicability. So before being able to help you, we'd need a problem reproduction using Jackson. Also: many if not most issues are hidden when people disable |
Beta Was this translation helpful? Give feedback.
-
We are using jackson for generating the API classes using open api.
below is the attribute spec used in the openapi.
When we try to post the API request, if the input for the searchEndDate is giving as Object instead of date-time value the jackson is setting null value to the deserialized object instead of throwing any type validation error.
In the above request body json, the searchStartDate is set as NULL in the deserialized object. We want to throw exception by jackson as the input value is not of type date-time. Can you please suggest how to achieve this.
we tried using the ALLOW_COERCION_OF_SCALARS, but that doesn't help here as it is doing the strict checks only for the primitive types.
Please do suggest is there any way to force jackson to validate these date time objects.
Beta Was this translation helpful? Give feedback.
All reactions