swagger-angular-generator icon indicating copy to clipboard operation
swagger-angular-generator copied to clipboard

Ignore 'Options' method

Open WTIGER001 opened this issue 5 years ago • 3 comments

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

WTIGER001 avatar Aug 20 '20 00:08 WTIGER001

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.

WTIGER001 avatar Aug 21 '20 00:08 WTIGER001

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

jnwltr avatar Aug 21 '20 01:08 jnwltr

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).

WTIGER001 avatar Aug 21 '20 02:08 WTIGER001