[Feature] Add ability to pass custom types for a string given a format hint
Author: paulst-caisCreated May 17, 2024Updated Sep 20, 2026
Labelsenhancement
What are the steps to reproduce this issue?
- Parse a property that is
type: string, but also contains the format hint, e.g.format: date-time
What happens?
There is config to parse these as a Date, but I want to be able to parse as a custom type.
What were you expecting to happen?
I was expecting this, but it would nice to have some more control.
I have a solution to allow a new config item, that will pass a format and return a type string:
if (context.output.override.customStringFormatResolver && item?.format) {
const type = context.output.override.customStringFormatResolver(item.format);
if (type) {
value = type;
}
}Any logs, error output, etc?
N/A
Any other comments?
Happy to implement this as a PR
What versions are you using?
Operating System: … Package Version: … Browser Version: …
Source: orval-labs/orval