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
I have searched existing issues to ensure the bug has not already been reported
Fastify version
5.1.0
Plugin version
4.0.0
Node.js version
20.11.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
24.1.0
Description
When working with fastify and its response serializer (fast-json-stringify), I noticed an inconsistency with how date objects are handled between fast-json-stringify and json-schema-to-ts.
The fast-json-stringify serializer allows me to directly provide a Date object, which is then correctly serialized to a date-time string format in the response. However, json-schema-to-ts requires the type definition to explicitly expect a string, not a Date, even though the JSON schema specifies a date-time format.
It would be helpful if json-schema-to-ts could accommodate Date objects when a JSON schema property is set to a date-time format, matching the behavior of fast-json-stringify.
The text was updated successfully, but these errors were encountered:
Prerequisites
Fastify version
5.1.0
Plugin version
4.0.0
Node.js version
20.11.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
24.1.0
Description
When working with fastify and its response serializer (fast-json-stringify), I noticed an inconsistency with how date objects are handled between fast-json-stringify and json-schema-to-ts.
The fast-json-stringify serializer allows me to directly provide a Date object, which is then correctly serialized to a date-time string format in the response. However, json-schema-to-ts requires the type definition to explicitly expect a string, not a Date, even though the JSON schema specifies a date-time format.
Example Schema:
response: { 200: { type: 'object', properties: { createdAt: { type: 'string', format: "date-time" }, } } }
Link to code that reproduces the bug
No response
Expected Behavior
It would be helpful if json-schema-to-ts could accommodate Date objects when a JSON schema property is set to a date-time format, matching the behavior of fast-json-stringify.
The text was updated successfully, but these errors were encountered: