日期时间在 Swagger 中被转换为毫秒数在响应中。

huangapple 未分类评论50阅读模式
英文:

date-time in swagger is getting converted to millis in response

问题

我对Swagger还不熟悉。
我正在尝试在Swagger中公开我们的合同。一切都如预期般工作,除了dateTime字段。我在Swagger的.yaml文件中指定类似这样的内容 -

myTime: {
  type: string,
  description: 'My Time.',
  format: date-time
}

在Swagger编辑器中,值绝对正确 - "2020-05-29T04:46:56.028Z"。
但是当我通过Postman触发API时,myTime的值以毫秒为单位返回。

非常感谢您的帮助。

英文:

I am new to swagger.
I am trying to expose our contract in swagger. Everything is working as expected, except the dateTime fields. I am specifying something like this in swagger .yaml file -

myTime: {
  type: string,
  description: 'My Time.',
  format: date-time
}

In swagger editor, the value is absolutely correct - "2020-05-29T04:46:56.028Z".
But when I am firing the api (via postman), the value of myTime is coming in millis.

Any help will be much appreciated.

huangapple
  • 本文由 发表于 2020年5月29日 13:08:34
  • 转载请务必保留本文链接:https://java.coder-hub.com/62079082.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定