Swagger
Metadata
Lecture equivalent | Duration |
---|---|
2 | 1h 30min |
At the end of this task, students
- have added Swagger to their
spring-starter
to automatically generate the REST API documentation
Listen
Task
Watch this ๐๐ผ
Then answer in a simple statement the following questions:
- Does it make sense to add a
CHANGELOG.md
tospring-starter
?- If yes, why?
- If no, why and how else will you document the project?
Read
Task
Read semver.org and agree its boring to read, yet again it is โ๏ธ crucial in our world!
Check these two videos to your extent to make sure you understood semver
:
Code
Task
Add Swagger to your spring-starter
using Setting Up Swagger 2 with a Spring REST API from baeldung.
- Step 8 ff. you do not have to do, they are too advanced and do not suit our use case for now.
- If you want to have a take at OpenAPI 3.0, try this tutorial.
No password?
If you apply the changes correctly, your API should ask for a password to see the docs, go back to spring-starter to remember why.
.antMatchers("/swagger-ui/**", "/v2/api-docs", "/swagger-resources/**").permitAll()
๐๐ฝ will actually make your docs public, if you want that ๐
Sample
You can find the sample solution here.