Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 1.5 KB

File metadata and controls

50 lines (33 loc) · 1.5 KB

Swagger UI

Table of contents

What is Swagger UI

Swagger UI is an interactive web page that lets you explore and test a REST API.

FastAPI auto-generates Swagger UI at the /docs path.

Actions:

Open Swagger UI

  1. Open in a browser: <lms-api-base-url>/docs.

    Replace the placeholder <lms-api-base-url>.

    You should see the Swagger UI with all endpoints listed.

Authorize in Swagger UI

If the API requires authentication:

  1. Open Swagger UI.
  2. Click the Authorize button (lock icon at the top right).
  3. In the Value field, enter the <api-key>.
  4. Click Authorize.
  5. Click Close.

All subsequent requests will include the API key in the Authorization header.

Try an endpoint in Swagger UI

  1. Open Swagger UI.
  2. Click on an endpoint (e.g., GET /items).
  3. Click Try it out.
  4. Fill in parameters if needed.
  5. Click Execute.
  6. See the response below: status code, response body, headers.