How to add a transformer? #1039
Replies: 3 comments 5 replies
-
@nickclassdojo can you provide your config and an example code you're looking to generate/use? |
Beta Was this translation helpful? Give feedback.
-
@mrlubos I have a similar question that goes in a slightly different direction, but also fits the title quite well: I would like to define a e.g. export class LocalTime {
hour: number;
minute: number;
constructor(hour: number, minute: number) {
this.hour = hour;
this.minute = minute;
}
}
then I would like to be able to parse this string into Maybe, I could create my own plugin for this? If this doesn't fit here, I'll open a separate topic or issue. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Based on reading the docs, I assumed that I would be able to add a transformer and pass this to the generation via some CLI option to change the output of the generated code (https://heyapi.vercel.app/openapi-ts/transformers.html). The docs don't explain how to add one, just how to add an existing internal one for dates. Is this something that's possible? My use case would be something along the lines of wrapping the return of a service function in some
Result
type.Beta Was this translation helpful? Give feedback.
All reactions