swagger-typescript-api icon indicating copy to clipboard operation
swagger-typescript-api copied to clipboard

Any ideas how to handle permissions? See details

Open amankkg opened this issue 4 years ago • 3 comments

We have a permission system in our backend done via enum per each endpoint. I'd like to somehow automate such logic.

One way of doing so if swagger will have enum string as a note to an endpoint like this

image

Is there a way to add that endpoint as TS literal type to a resulting class or method? Or, maybe there are other ways to achieve a similar outcome?

amankkg avatar Apr 15 '21 04:04 amankkg

You can do any kind of manipulations with custom templates using --templates option

js2me avatar Apr 23 '21 06:04 js2me

Yeah, thanks, I've been looking through it. If you don't mind keeping this issue open then I'd like to reply here once I'll get something viable

amankkg avatar Apr 23 '21 09:04 amankkg

@amankkg Can you show result ts code which you want to have ?
Also I need part of your swagger schema

js2me avatar Apr 23 '21 11:04 js2me