Export api definition from AWS API Gateway

I am creating an entire API in the AWS API Gateway. Since I use the graphical console, just because I'm in the training phase, I will need some way to create the same API programmatically or through the CLI. Are there any possibilities for exporting the current API set in some way, can I reproduce the same structure?

+6
source share
5 answers

I just published a tool to export existing APIs from Amazon API Gateway:

Amazon API Gateway Swagger Exporter

https://github.com/isabinin/aws-apigateway-swagger-exporter

I hope you find this helpful.

+6
source

this feature is now available through the CLI directly from Amazon. It produces the same output as the Amazon GUI console.

swagger

aws apigateway get-export --rest-api-id a1b2c3d4e5 --stage-name dev --export-type swagger /path/to/filename.json 

Swagger + Gateway Extension API

 aws apigateway get-export --parameters extensions='integrations' --rest-api-id a1b2c3d4e5 --stage-name dev --export-type swagger /path/to/filename.json 

swagger + postman expansion

 aws apigateway get-export --parameters extensions='postman' --rest-api-id a1b2c3d4e5 --stage-name dev --export-type swagger /path/to/filename.json 

For more information: http://docs.aws.amazon.com/cli/latest/reference/apigateway/get-export.html

+6
source

There is currently no support for exporting your API definition using the Gateway API, but this is a very requested feature and we are exploring how best to support it.

+1
source

This feature is now commonly available through the Gateway API console.

+1
source

Open the CLI and run the following command

 aws apigateway get-export --parameters extensions='apigateway' --rest-api-id **<aaaaabcdefg123>** --stage-name dev --export-type swagger latestswagger2.json 

or

Go to the scene and export it

enter image description here

0
source

Source: https://habr.com/ru/post/1235763/


All Articles