3

I'm using Swagger w/ AWS API Gateway. In order to fully support CORS, I have several OPTIONS methods in my swagger file; they exist only to tell API Gateway to return CORS headers so that preflight requests from my Angular app succeed.

However, when I use Swagger codegen to generate the API, all of those OPTIONS methods come across in my service as real methods. I don't want this to be the case.

How can I tell Swagger Code Gen to skip over certain, specific methods; for instance, putting a tag on the OPTIONS methods so that Swagger CodeGen doesn't generate code for those particular HTTP verbs?

user1543276
  • 436
  • 5
  • 11
  • Which language/target are you generating? How do you run the codegen (manually from command line, from http://editor.swagger.io, from http://generator.swagger.io, etc.)? – Helen May 21 '18 at 06:41
  • Targeting Angular-Typescript, and I'm running it from the command line via the java command against the JAR file. – user1543276 May 22 '18 at 10:20

0 Answers0