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
source share