Repository navigation
Java OpenApi format date #2924
|
Hello, I am using OpenApi in my Java project. In my yaml file I used type string and format date. But I am facing one issue with the year. Thank you. |
Replies: 2 comments
|
20223131 is a valid year, albeit not very likely to be the correct value in your application. You could add an extra check like |
|
Closing as answered - if that |
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.