Skip to content

Java OpenApi format date #2924

Closed Answered by karenetheridge
danosavraam asked this question in Q&A
Discussion options

You must be logged in to vote

20223131 is a valid year, albeit not very likely to be the correct value in your application.

You could add an extra check like "maxLength": 10" or "pattern": "^\d{4}-\d{2}-\d{2}$" to ensure that you get four-digit years.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by handrews
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants