openapi-eller icon indicating copy to clipboard operation
openapi-eller copied to clipboard

Add support for handling custom date formats

Open bbqsrc opened this issue 7 years ago • 0 comments
trafficstars

Custom date formats are a super common "feature" of the real world, and mapping APIs to the real world, particularly with custom date formats is a pain point with OpenAPI.

There's a few ways we can go about implementing this, but having a coherent story that is easily implemented in each platform would be great.

A couple of ideas have been proposed:

  • Using a custom format with formatting string as a parameter, like custom-date(mm-yyyy-DD), though this introduces parsing complexity
  • Using a custom field along side a well known custom format, such as:
type: string
format: custom-date
x-date-format: mm-yyyy-DD

Both have their pros and cons.

bbqsrc avatar May 16 '18 09:05 bbqsrc