wcandillon / swagger-js-codegen

A Swagger Codegen for typescript, nodejs & angularjs
Apache License 2.0
693 stars 286 forks source link

Support enum values #188

Open diogocravo opened 7 years ago

diogocravo commented 7 years ago

I wanted to be able to validate whether a parameter the client is sending matches the enumerated values in the swagger. Unfortunately as of today that validation is only possible if the enum is also a singleton, or am I missing something?

Ryuno-Ki commented 7 years ago

Hi, @diogocravo!

You would need to patch https://github.com/wcandillon/swagger-js-codegen/blob/9092973b7d3a5d893abe3109a6b73b4de7c38d6a/lib/typescript.js#L24

Ideally it should be easily able to patch each individual value in my opinion …