kjayasa / swagger-ts-client

A tool to generate typescript http clients and types from swagger definitions
MIT License
27 stars 24 forks source link

Support for required properties #21

Closed vankeisb closed 4 years ago

vankeisb commented 5 years ago

Adds the required information into the IProperty instance, making it available in templates.

This allows to support Swagger's required fields (https://swagger.io/specification/#schemaObject) instead of the current "all or nothing" policy (with membersOptional).

Only 2 files have been modified (type.ts and typeBuilder.ts), the rest has been generated by the build. Not really sure why, but I commited all those for practical reasons. For now, I'm depending on the forked lib via a git tag. I'll get back the the official version if the PR is merged.