#Springdoc #OpenAPI #SwaggerUI #OpenAPIDiff #APIDocumentation #RESTAPI #JavaAPI #APIComparison #APITutorial
🎥 In this video, I demonstrate how to work with Springdoc OpenAPI, Swagger UI, and the OpenAPI Diff CLI tool.
We will explore:
✅ Setting up Student and Address API with Swagger UI
✅ Generating API documentation using springdoc-openapi
✅ Testing APIs directly from Swagger UI
✅ Using openapi-diff-cli tool to compare API specifications
Exporting results to JSON, HTML, and Markdown formats
🔗 Swagger UI: http://localhost:9090/swagger-ui/index.html
🔗 OpenAPI Diff CLI (Maven): Maven Repo
🔗 Official Docs: OpenAPI Diff GitHub
Docs:
https://springdoc.org/#general-overview
https://repo1.maven.org/maven2/org/op...
Code : https://github.com/chakricodesjava/Sp...
API Documentation & Management: A Brief Timeline
Timestamps
00:00 Intro and goal: document/test APIs with Springdoc OpenAPI + Swagger UI, plus diff reports.
00:28 Add springdoc-openapi starter dependency and explain what it auto‑generates.
01:19 App up on port 9090.
01:29 Open Swagger UI at /swagger-ui/index.html and explain auto‑redirect.
01:38 Access OpenAPI JSON at /v3/api-docs and why clients use it.
02:11 Non‑prod vs prod note: exposing Swagger in dev/test, toggling in prod.
02:34 Glance at official docs; features and controller advice mention.
02:58 Web stack note: WebFlux vs Tomcat and threading model aside.
03:50 Open pom.xml; review core dependencies for Spring Web, validation, and springdoc UI.
04:43 OpenAPI bean config (SwaggerConfig) to customize title, contact, license.
05:24 Comment out custom bean to show default UI; then roll back to custom metadata.
06:11 Address entity added; annotate fields with NotBlank, size constraints, nullable notes.
07:51 Validate in Swagger UI: missing city/state returns 400 with clear messages.
08:31 Enforce max length (e.g., city ≤ 50 chars) and observe validation errors.
09:33 Apply @Valid in controllers so bean constraints fire on save/update.
10:12 Custom exceptions (StudentNotFound, AddressNotFound) and messages.
10:42 Global error handling with @RestControllerAdvice to standardize responses.
11:25 Service throws custom exception path; controller advice catches and formats.
12:06 Versioned API docs concept and why spec versions drift.
12:42 Real‑world ask: compare old vs new OpenAPI specs for changed/added/deleted endpoints.
13:07 Introduce openapi-diff CLI; outputs HTML/JSON/Markdown reports.
14:01 Snapshot specs: download old and new /v3/api-docs to JSON files via CLI/URL command.
15:13 Save a v3 snapshot too; prep both files for comparison.
15:30 Visual diff walkthrough: version, names, and endpoint changes.
16:28 Run CLI: java -jar ... generate detailed HTML diff report and open in browser.
17:06 Report tour: added/removed endpoints and parameter changes called out.
17:30 Export JSON/Markdown variants for automation or docs.
18:36 Why HTML is client‑friendly and helps reviews.
19:01 Recap: value of keeping docs in sync and comparing before releases.
20:42 Swagger UI data setup: start with no records and show 404 for missing ID.
22:14 Postman demo: create students via POST.
23:10 Fetch all students and verify multiple records.
24:10 Update with PUT; validate and confirm changes in Swagger UI.
25:27 Why diffing specs matters across releases; mapping to client requests.
26:25 Download JAR, capture specs via URL, run CLI with HTML/Markdown/JSON outputs.
27:27 Command recap and where to place official links in description.
28:02 Closing remarks and next‑steps on Spring/Spring Boot microservices.
If you find this helpful, don’t forget to like, share, and subscribe for more API tutorials! 🚀
На этой странице сайта вы можете посмотреть видео онлайн Springdoc OpenAPI Tutorial: Swagger UI, API Testing & API-Diff CLI (JSON/HTML/Markdown Export) длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Chakri Codes Java 16 Август 2025, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 101 раз и оно понравилось 0 зрителям. Приятного просмотра!