json schema validation error with LocalDateTime-array found, string expected


This Content is from Stack Overflow. Question asked by Loren

I am validating date of type java.time.LocalDateTime using json-schema. But I am getting below error

message= array found, string expected


"dateInvoiced": {
              "type": "string",
              "format": "date-time",
               "minLength": 1

Value I am passing in json – 2021-12-01T07:16:31Z

I don’t want to check any specific Date format. Is there any other way to handle java 8 LocalDateTime in json schema because in past I havn’t face any issues with java.util.Date.


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?