Manweill / swagger-axios-codegen

swagger client to use axios and typescript
MIT License
306 stars 83 forks source link

WIP: Add class-transformer to transform results and support dates #42

Closed arkraft closed 5 years ago

arkraft commented 5 years ago

This MR adds https://github.com/typestack/class-transformer to transform the result types. Strings, which have the a format of date or date-time are now transformed to a Date instance.

The default option used for class-transformer is to ignore all additional parameters. So the transformed result Object only contains the parameters defined inside the DTO or generated model and additional parameters returned by the API are ignored.

There is an option to enable class-transformer which is false by default and therefore it does not break any existing usage.

Manweill commented 5 years ago

@arkraft Can you provide a example. And then, fixes checks.

arkraft commented 5 years ago

I wanted to add examples and update the README. The WIP in the title actually stands for 'Work In Progress', There where a few things i still wanted to check out