jnwltr / swagger-angular-generator

Generator of API layer in TypeScript for Angular 2+ apps
MIT License
91 stars 46 forks source link

Ignore 'Options' method #126

Open WTIGER001 opened 4 years ago

WTIGER001 commented 4 years ago

Allow us to not generate an api method for http options.

WTIGER001 commented 4 years ago

When I try to use an 'options' method I get an error where it goes to generate the method. The allowed field is undefined. Line 25 of 'process-methods.ts'

const allowed: string[] = conf.allowedParams[method.methodName];

returns an undefined value because 'options' is not an allowedParams property.

jnwltr commented 4 years ago

Could you, please, post an example of your schema with options method? It seems conf.ts should be extended.

WTIGER001 commented 4 years ago

api.zip Here is the schema. I tried adding operationids but that did not help. Thanks. I really just want to skip creating api methods (for the options methods that are required for CORS support in the AWS API Gateway).