Skip to content
Ameen Abozaid
Planned lessonJNR-021-L02

Generating docs from Spring (springdoc)

  • Lesson 2 of 5
  • Junior
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

get a spec and Swagger UI from existing code.

Planned topics

  • springdoc-openapi reads your controllers and DTOs and builds the spec at run time. Verify the artifact name and version for your Spring Boot version before recording.
  • The spec is served as JSON (commonly at /v3/api-docs).
  • Swagger UI is a web page (commonly /swagger-ui.html) where you read and try endpoints.
  • Annotations such as @Operation and @Schema add detail where the code alone is not enough.
  • In production, decide whether the docs endpoints should be public.
Draft outline details

Demonstration

add the starter dependency, run the app, open the UI, and call GET /products with "Try it out".

Check your understanding

What is Swagger UI for?

Show answer

Reading and trying the API in a browser.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.