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
The OpenApi spec says, that for dates, the field should use {"type":"string", "format": "date-time"}. The inofficial standard format for dates seems to be ISO 8601.
Fields that contain Dates are exported as {"type": "number"} by Kitura.
This is unfortunate because, when generating a client library from that spec, the date field with have a numeric type instead of date. This is not the case when the field uses {"type":"string", "format": "date-time"}.
I attempted to configure the JSON encoder and decoder with dateEncodingStrategy = .iso8601. This changes the typo to string, but still doesn't contain the format, so the generated code will have a field of type String, not Date.
Environment Details
Mac OS 10.15, Xcode 12.0.1, Swift 5.3, Kitura 2.9.1
Steps to Reproduce
Create a struct with a Date field and a route returning that struct, look at the OpenAPI specification.
Expected vs. Actual Behaviour
[ Expected] The date type is {"type":"string", "format": "date-time"}, at least after setting the date encoding strategy to .iso8601.
[ Actual] Date type is number or string without format
The text was updated successfully, but these errors were encountered:
Context and Description
The OpenApi spec says, that for dates, the field should use
{"type":"string", "format": "date-time"}
. The inofficial standard format for dates seems to be ISO 8601.Fields that contain Dates are exported as
{"type": "number"}
by Kitura.This is unfortunate because, when generating a client library from that spec, the date field with have a numeric type instead of date. This is not the case when the field uses
{"type":"string", "format": "date-time"}
.I attempted to configure the JSON encoder and decoder with
dateEncodingStrategy = .iso8601
. This changes the typo to string, but still doesn't contain the format, so the generated code will have a field of typeString
, notDate
.Environment Details
Mac OS 10.15, Xcode 12.0.1, Swift 5.3, Kitura 2.9.1
Steps to Reproduce
Create a struct with a Date field and a route returning that struct, look at the OpenAPI specification.
Expected vs. Actual Behaviour
{"type":"string", "format": "date-time"}
, at least after setting the date encoding strategy to.iso8601
.number
orstring
without formatThe text was updated successfully, but these errors were encountered: