Downloaded Swagger Pet Store (Simple) from swagger.io editor page and did a mvn jetty:run
When opening up DevTools on Chrome and exercising a GET, I don't see the header Content-Type field being set.
This is on the GET /pets{id}
Swagger Codegen is available for download in the GitHub repository, or can be generated for any new or existing OpenAPI-defined API in the integrated SwaggerHub platform.
The Swagger Codegen is an open source code-generator to build server stubs and client SDKs directly from a Swagger defined RESTful API. The source code for the Swagger Codegen can be found in GitHub.
OK, found the root cause of this problem thanks to wing328 on the swagger codegen project on github.
It turns out that at the top of our yaml definition file we have:
consumes: - application/json
That causes all generated controller methods to expect application/json on content-type. This breaks GET, DELETE, and PATCH api calls which in our case do not have any payload.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With