How to map string with date-time pattern into typescript Date object

Viewed 255

I use openapi-generator to obtain auto generated TypeScript code. Property declared in c# in background as DateTime appears in swagger.sjon as

"type": "string", "format": "date-time"

As I know generation could be fired with parameter

--type-mapping=string=Date

then all of strings become a Date objects. My question is how to run generation to change all properties with type string and format equal to date-time onto Date object in TypeScript and don't change other string's properties?

0 Answers
Related