Swagger UI
Last updated
Last updated
Swagger UI offers a web-based UI that provides information about the service, using the generated OpenAPI specification. Both Swashbuckle and NSwag include an embedded version of Swagger UI, so that it can be hosted in your ASP.NET Core app using a middleware registration call.
The web UI looks like this:
Each public action method in your controllers can be tested from the UI. Select a method name to expand the section. Add any necessary parameters and select Try it out!
The Swagger UI version used for the screenshots is version 2, while latest versions also exist.
This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io
For this sample, you can use the api key special-key
to test the authorization filters!
Try getting a pet with id 2 (id 1 does not work for some good reason!)