Repository metrics
- Stars
- (6,272 stars)
- PR merge metrics
- (PR metrics pending)
Description
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.