I'm using Swagger w/ AWS API Gateway. In order to fully support CORS, I have several OPTIONS methods in my swagger file; they exist only to tell API Gateway to return CORS headers so that preflight requests from my Angular app succeed.
However, when I use Swagger codegen to generate the API, all of those OPTIONS methods come across in my service as real methods. I don't want this to be the case.
How can I tell Swagger Code Gen to skip over certain, specific methods; for instance, putting a tag on the OPTIONS methods so that Swagger CodeGen doesn't generate code for those particular HTTP verbs?
Related
It seems that when we use Swagger (SpringDoc) UI for the gateway, when a request is sent through it, the request is made directly to the service and not through the gateway. For example, in this example (linked from SpringDoc documentation), the swagger ui address is 158.101.191.70 while the request is being made to 172.17.0.9.
Isn't an important point of using swagger to let API users know what APIs we have and be able to test them? Thus, shouldn't the requests be made through the gateway and not directly? Maybe, they don't even have access to the services directly. Is there a solution?
I am currently looking into adding Swagger to an API that I work on. I found rswag, but from what I can tell, I would have to manually write specs for every endpoint in my API. This API has hundreds of endpoints, so this isn't very feasible.
Django REST Framework has SchemaGenerator which can generate an OpenAPI schema, either as a static file to commit and edit as you see fit or a dynamic endpoint which can be consumed by Swagger UI. Is there any equivalent for Ruby on Rails?
As a side note, I am also using jsonapi-resources. I'd be open to tools that are specific to JSON API.
We use swagger in our project and while testing endpoints I need to authenticate in Swagger page (https://localhost:5001/api/index.html). As far as I remember, there was a way to copy the jwt of the current session and paste it to request header, etc. But I have not succeeded with this approach. Is there a proper way e.g. using Swagger Inspector as mentioned on How to Perform a Basic API Test In 3 Steps? Or a smarter way?
I have implemented AWS API Gateway, which has many API methods. Currently, I have created a swagger definition file (JSON format) and imported this file AWS API Gateway though the "import" option available. I am also developing REST API services in springboot that gets called from the AWS API Gateway. The REST API Service has 20 API methods and I want to have these 20 API Methods in API Gateway. I do not want to manually maintain a Swagger definition file, containing the definition for these 20 API methods. I would like to know if I can generate Swagger definition file from SpringBoot API.
I know that Swagger can create HTML documentation from the REST API but I did not find any tool that could convert this HTML to a Swagger definition file. I also know that Swagger inspector can generate the definition file, but I have to manually call each service endpoints manually to create the definition file.
Is it possible to get the Swagger for an individual endpoint from Swashbuckle? I would like to be able to build individual Swagger documents from each endpoint in my API solution, rather than including all operations in all endpoints.