arjun-g / vs-swagger-viewer

Swagger Viewer lets you preview and validate Swagger 2.0 and OpenAPI files as you type in Visual Studio Code.
MIT License
170 stars 47 forks source link

Read swagger object as part of bigger json #51

Open jsve opened 5 years ago

jsve commented 5 years ago

It would be useful to be able to read the swagger part of a Cloudformation template, when declaring an AWS API Gateway.

The syntax is the same, and is placed under a "Body" tag in the config (see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-body).

Possible solution would be to parse the entire json for any swagger/openAPI version field (swagger: "2.0" or openapi 3.0.0) and use the containing object as input for this plugin. Support for multiple apis in same Cloudformation Template is probably not needed, since one would probably use separate files for more complex projects like this.