A simple collection of ruby scripts to collect data from /actuator/mappings
and visualize all endpoint connections and the API "tree".
Exemple generatet using example spring project PetClinic.
Added to application.properties
...
management.endpoints.enabled-by-default=true
...
This projects properties.conf
{
"URL_BASE": "http://localhost:8080",
"MAPPING_ENDPOINT": "/actuator/mappings",
"CLASS_PREFIX": "org.springframework.samples.petclinic",
"OUTPUT_FILE_NAME": "diagram.png"
}
In the folder resources you need create a file called properties.conf
.
This is expected to be a JSON with keys
"URL_BASE"
- Base url to your Spring app API"MAPPING_ENDPOINT"
- actuator endpoint for mapping. If you did not change anything and just enabled it, then it is"/actuator/mappings"
,"LOGIN_ENDPOINT"
- endpoint for the login to your app. If you leave it empty then the script will skip logging in."CLASS_PREFIX"
- prefix of your controller classes. Your organization should suffice"OUTPUT_FILE_NAME"
the name of the output file png
Spring app needs to be running
$> bundle install
$> rake run
Not implemented yet. As this is more excercise project then an enterprise ready solution. but you can run rake lint
- how to add metadata like method, params, etc.?
- clean up the code
- add tests