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
This is incredibly error prone because users might insert strings that look like dates anywhere such as in the user name field upon registration.
You could also generate zod validations and use those to parse the dates. However that is a manual process. Orval does not produce information that allows me to automatically associate an API client function with a validation function at runtime.
What Is to Be Done?
Orval should provide a function for every request schema and a function for every response schema that will transform dates according to what is declared in the schema.
Later we could allow users to customize these functions in order to use a third party date library or to automatically process altogether custom types.
The text was updated successfully, but these errors were encountered:
I thought so too, but #1432 just aims to make the type definition of a date configurable. That is, change it from string or Date to SomeThirdPartyDate in the type definitions.
When you enable the
useDates
option you yourself are responsible for finding dates in response objects and processing them accordingly.The documentation recommends the use of a Regexp.
This is incredibly error prone because users might insert strings that look like dates anywhere such as in the user name field upon registration.
You could also generate zod validations and use those to parse the dates. However that is a manual process. Orval does not produce information that allows me to automatically associate an API client function with a validation function at runtime.
What Is to Be Done?
Orval should provide a function for every request schema and a function for every response schema that will transform dates according to what is declared in the schema.
Later we could allow users to customize these functions in order to use a third party date library or to automatically process altogether custom types.
The text was updated successfully, but these errors were encountered: