Best way to denote time (without date) in Swagger spec

前端 未结 1 1932
梦如初夏
梦如初夏 2021-01-14 15:31

What is the best way to represent a time field in a swagger specification, the closest type to denote it looks like date-time but this makes standard deserialis

相关标签:
1条回答
  • 2021-01-14 15:49

    Depending on what you're trying to represent, this may or may not be a good idea.

    If you want to represent a specific timestamp, then it's probably much safer to include the date.

    If the date really isn't important (eg. you want to indicate that an event takes place at 14:00 every day), then I don't believe swagger has a built in format for that. However, the swagger format field is open and swagger has support for ECMA 262 regex string patterns.

    0 讨论(0)
提交回复
热议问题