You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, dates have been returned in milliseconds since 1970, encoded as integers:
"time": {
"description": "The time",
"type": "integer"
},
The closest date format supported by autorest is:
"time": {
"description": "The time",
"type": "integer",
"format": "unixtime"
},
But the value is expected to be a number of seconds. And it can't be a fraction as I see.
The format which supports milliseconds is RFC3339, e.g. "2024-08-14T12:21:37.468Z":
"time": {
"description": "The time",
"type": "string",
"format": "date-time"
},
An advantage of this format is that it is human-readable.
So, to improve the developer experience, I propose returning all times in one of the above formats. The way it is currently implemented in the middleware is the same as in the node, but I'm going to propose the same thing to the node.
I think it is best we keep it the same as the node. If a consensus is reached on the node issue, that leads to a change, we can then also make the change.
davidyuk
changed the title
Return date-time in swagger/autorest-compatible format
Return date-time in OpenApi/autorest-compatible format
Aug 23, 2024
Currently, dates have been returned in milliseconds since 1970, encoded as integers:
The closest date format supported by autorest is:
But the value is expected to be a number of seconds. And it can't be a fraction as I see.
The format which supports milliseconds is RFC3339, e.g.
"2024-08-14T12:21:37.468Z"
:An advantage of this format is that it is human-readable.
So, to improve the developer experience, I propose returning all times in one of the above formats. The way it is currently implemented in the middleware is the same as in the node, but I'm going to propose the same thing to the node.
https://swagger.io/docs/specification/data-models/data-types/#string
http://azure.github.io/autorest/openapi/formats.html
The text was updated successfully, but these errors were encountered: