Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access AWS API Gateway documentation using Swagger UI

I have created API using AWS Api Gateway. Then i have documented documentation parts for all the entities ( like API, RESOURCE, METHOD, MODEL etc). Then using AWS Gateway Console i have published the documentation to dev stage with version 1

But i am not sure how do i (or the consumer of the API) going to access the documentation?

There is an Export option that can export documentation as Swagger or OpenAPI3. This will create .json or .yaml file and then consumer has to import these files into swagger UI. However this is not user-friendly option to provide swagger file every time i update documentation to all consumers.

I was wondering, after publishing the documentation is there anyway consumer can access documentation directly via http. So lets assume my dev stage api URL is https://devapi.example.com/v1 so something like https://devapi.example.com/v1/help should launch Swagger UI with latest published swagger file.

Update 1
In ASP.NET Web API or .NET Core you can include Swashbuckle that creates swagger files and also has embedded version of the Swagger UI tool. So after deploying API user can access documentation directly from UI something like https://devapi.example.com/swagger.
I was hoping the same thing from AWS gateway. After publishing the documentation it should make that documentation available via some predefined resource path.

like image 507
LP13 Avatar asked Jan 15 '19 20:01

LP13


People also ask

Can Swagger documentation be used for AWS API gateway setup?

It is a fully managed platform which allows users to build, deploy and manage APIs at any scale. The important aspect of the Amazon API Gateway is that it supports the Swagger definition format for designing and building RESTful APIs, and as you know, SwaggerHub is all about the Swagger!

How do I access Swagger AWS?

Navigate to S3 in AWS console and create a bucket with some name like swagger-bucket . Under the properties tab, enable Static website hosting and make a note of the link provided. In the Index Document, enter the name of the document as index.

How do I access Swagger documents?

If the Swagger API documentation does not display automatically, in the Swagger Explore field, type the URL to the location of the Swagger documentation: https://<SnapCenter_IP_address_or_name>:8146/Content/swagger/SnapCenter.yaml or https://<vCenter_host_IP_address>:8146/Content/swagger/SnapCenter.yaml, and click ...


Video Answer


1 Answers

AWS API Gateway can only make documentation exportable but won't render a UI app. There is no endpoint that you can use in the gateway to render the documentation. You may wish to use third party tools or AWS API Gateway Developer Portal to allow users browse API documentation. You may find this blog helpful.

like image 135
A.Khan Avatar answered Sep 18 '22 19:09

A.Khan