Documenting RESTful APIs with Spring REST Docs
summary
A test-driven workflow that uses Spring REST Docs plus Asciidoctor to generate real request/response snippets from integration tests, hooked into Gradle or Maven, produces HTML/PDF docs and pushes to GitHub Pages. Example app: a greetings API with POST/GET endpoints, generated curl/postman examples, and reusable snippet templates; tests fail when fields change so documentation stays accurate. Works with WebFlux, Ratpack and REST-assured, and integrates with Postman or curl.
AI-written summary · about
chapters (15)
- 0:00Introduction to talk
- 3:46Understanding API documentation needs
- 7:06Common API documentation challenges
- 13:54Documentation tooling landscape
- 19:37Problems with Swagger
- 25:43Test-driven documentation concept
- 28:54Spring REST Docs overview
- 31:53Setting up Spring REST Docs
- 35:43Writing tests with WebTestClient
- 40:49Generating documentation snippets
- 45:55Integrating snippets into docs
- 49:37Customizing documentation output
- 52:10Publishing documentation
- 54:37Using REST Docs with other frameworks
- 55:45Conclusion and resources
related talks
52mTest-driven documentation with Spring REST Docs
01h 23mDocumenting RESTful APIs
50mSpring REST Docs: Documentation From Tests, Not the Other Way Around
41mIntroducing Spring Auto REST Docs
26mDocumenting Your API Effectively: a Complete Tour of Spring-doc
46mJUnit, RESTDocs, Asciidoctor and Maven to document your APIs
51mDocumenting RESTful APIs with Spring REST Docs and RAML
35mBringing together OpenAPI 3 and Spring Boot
