0

At the moment I have:

type: string
format: YYYY-MM-DD

How can I match a date formatted like: Jan 22, 2020?

Is there a predefined way or I have to create a kind of regex? Is it possible to use pattern instead of format?

Helen
  • 87,344
  • 17
  • 243
  • 314
Stefano Maglione
  • 3,946
  • 11
  • 49
  • 96
  • Check this link. https://stackoverflow.com/questions/49379006/what-is-the-correct-way-to-declare-a-date-in-an-openapi-swagger-file – Ashish Karn Jun 17 '20 at 10:10
  • @AshishKarn this question is about a different format of dates, so the answers in the linked Q&A don't apply here. – Helen Jun 17 '20 at 10:15

1 Answers1

0

I got an idea with regex, even tough is not matching it strictly:

type: string
pattern: '^[a-zA-Z]+ [0-9]+, [0-9]+$'
Stefano Maglione
  • 3,946
  • 11
  • 49
  • 96