serverless-aws-documentation icon indicating copy to clipboard operation
serverless-aws-documentation copied to clipboard

HTTP OPTIONS are always grouped in default tag

Open pj035 opened this issue 7 years ago • 3 comments

Hey guys it seems that the plugin does not set the tags for the CORS paths.

In the example, which is included in this repo, two tags are defined and two functions. The generated swagger file by the APIG does not include the tags field for the cors paths. In the picture you can see that the OPTIONS methods are grouped by the default tag.

Is there any way to set the tags to the associated function. I.e. OPTIONS /example/do-something would be seen within Tag2 and so on. I couldn't find anything in the documentation nor on Google.

Steps to reproduce:

  1. Deploy example of this repo to AWS
  2. Download yaml file from APIG
  3. Render in swaggerUI or similar tool (or have a look at the yaml file itself ;-) )

swagger-ui-example

pj035 avatar Feb 08 '18 09:02 pj035

yes, this is a problem,

And heres another options issue: if you try and export swagger from api gateway, in the case where you have path params, swagger will give errors "Declared path parameter "[parametername]" needs to be defined within every operation in the path (missing in "options"), or moved to the path-level parameters object"

how does one define path level object in documentation? or for that matter options if you're using lambda proxy??

shawngrona avatar May 24 '18 17:05 shawngrona

@pj035 #86

pig800509 avatar Jul 18 '18 03:07 pig800509

@pig800509 so basically you are postprocessing the swagger file and remove the options tag? I came up with a similar solution in our projects. Seems to be the only option right now.

pj035 avatar Jul 18 '18 06:07 pj035