agrestio / agrest

Server-side Java REST Framework for easy access to data graphs from various backends
https://agrest.io
Apache License 2.0
80 stars 34 forks source link

OpenAPI to use format="partial-time" for time attributes #549

Closed andrus closed 2 years ago

andrus commented 2 years ago

Originally mentioned here:

We have noticed that openapi lost the attribute format="time" for type="string" where db time of a field is a time.

andrus commented 2 years ago

Actually we even had a test for this condition. Turns out Open API spec as of v3.0.3 only defines formats for "date", and "date-time". There's no "time". They are floating the ideas of a "format registry", but doesn't look like it exists.

On the other hand, the Swagger library that we are using actually has optional support for times. Will turn it on for Agrest. The format will be called partial-time (not "time").