Forum Discussion

Satheeshvid's avatar
5 years ago

Swagger open API - date-time pattern is allowing yyyy value

Swagger 3.0 by default validating against pattern ^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z)*$ for given date-time field in swagger but its allowing just year without error

{ "date":"2020" - allowing this value }

date = 2020-06-16T13:22:01.Z - validating this value properly but allowing just year where it need to restrict as per RFC3339 date-time pattern.

Is this bug in swagger or some jar wrongly validating the date ?
No RepliesBe the first to reply