Spring boot document configuration properties

514 Views Asked by At

I'm trying to automatically document my configuration properties in order to create a html like the one on spring boot appendix for it's configuration. I see that I can enable configuration metadata here https://docs.spring.io/spring-boot/docs/2.6.6/reference/html/configuration-metadata.html but what i want is to create a html page like we can do with spring rest docs for the api. Is there a way to achieve this using spring or have I to do it manually (maybe starting from the metadata)?

2

There are 2 best solutions below

0
On

The Spring Boot Actuator will show your properties but the default output is JSON. You should be able to add custom code to produce the output you want.

0
On

A few months ago this project was created and this is what you are looking forward, it can generate AsciiDoc, Markdown, HTML or XML documentation from your spring-configuration-metadata.json that is being built by the `spring-boot-configuration-processor dependency.

Give it a try, it has Maven and Gradle plugin as well, feel free to open issues if you encounter some bugs :)

https://github.com/rodnansol/spring-configuration-property-documenter