WebAPI Module 1
  • Introduction
    • Presentation
    • Overview of REST
    • Open API
    • Swagger UI
  • Getting started
    • Create a project
    • Build and test
    • Understand controller
  • Create pizza API
    • Add a data store
    • Add a controller
    • Understand CRUD
    • Implement CRUD
  • Project Repo
Powered by GitBook
On this page
  • Swagger UI
  • Note
  • Try a demo
  1. Introduction

Swagger UI

PreviousOpen APINextCreate a project

Last updated 1 year ago

Swagger UI

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:

Swagger UI

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!

Note

The Swagger UI version used for the screenshots is version 2, while latest versions also exist.

Try a demo

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!)

Example Swagger GET test

This is a sample server . You can find out more about Swagger at

Petstore server
http://swagger.io
LogoSwagger UI