moto icon indicating copy to clipboard operation
moto copied to clipboard

Apigateway REST getExport as Swagger

Open calvernaz opened this issue 3 years ago • 3 comments

Currently the operation get_export is not covered in moto, this issue is just to formalize the request to cover this functionality.

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-export-api.html

calvernaz avatar Feb 24 '22 14:02 calvernaz

Thanks for raising this @calvernaz, will mark it as an enhancement.

In general, features like this are supplied by the community, so if this is something you want to contribute, a PR would be very welcome! See our docs if you want more info on how to get started: http://docs.getmoto.org/en/latest/docs/contributing/index.html

bblommers avatar Feb 24 '22 14:02 bblommers

Thanks @bblommers, I might give it a whirl! Do you have any tips or similar work how this can be achieved?

calvernaz avatar Feb 25 '22 17:02 calvernaz

The only similar work around this is the import_api function for APIGatewayV2, but that is a very crude and simplistic:

https://github.com/spulec/moto/blob/master/moto/apigatewayv2/models.py#L625:L627

Considering the scope of this method, my tip would be to keep it simple. If you only need 2% of the full OpenAPI spec, only implement that part - every bit helps.

If you ever get stuck, or can't figure out how to make it work, don't be afraid to open a draft PR with what you have so far - happy to have a look and help out!

bblommers avatar Feb 25 '22 20:02 bblommers

Moto now also has this feature, although not all fields/options are supported yet. Please let us know if you run into any issues with our implementation.

bblommers avatar Jan 14 '23 16:01 bblommers