If you’re building a rest api with spring-boot and want to document the api, you have two good options to do this; Springfox, or Spring REST Docs.
Springfox creates (interactive) documentation through a swagger-ui to use by a developer, Spring REST Docs creates documentation via asciidoc.
And what’s best is that you can simply combine the two in a project.
I wanted to create some connection or similarity between the swagger-ui and asciidoc documentation.
I came across a blogpost by mrhaki that inspired me to extend the snippets in his example.
Using the following snippets, it’s possible to label HTTP verbs in the Spring REST Docs in the same colors as in the swagger-ui.
Below is the docinfo.html with the CSS style definitions.
It contains colors for all verbs, corresponding to the default swagger-ui colors.
This gives the following result in the Spring REST Docs output.