https://github.com/zejnilovic/spring-api-visualizer
Generates a tree graph of your spring API endpoints
https://github.com/zejnilovic/spring-api-visualizer
api graphviz spring visualization
Last synced: about 2 months ago
JSON representation
Generates a tree graph of your spring API endpoints
- Host: GitHub
- URL: https://github.com/zejnilovic/spring-api-visualizer
- Owner: Zejnilovic
- License: apache-2.0
- Created: 2021-01-14T21:49:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-16T20:21:36.000Z (almost 2 years ago)
- Last Synced: 2025-05-29T06:57:35.836Z (about 1 year ago)
- Topics: api, graphviz, spring, visualization
- Language: Ruby
- Homepage:
- Size: 84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spring API Endpoints visualization
A simple collection of ruby scripts to collect data from `/actuator/mappings` and visualize all endpoint connections and the API "tree".
### Example
Exemple generatet using example spring project [PetClinic](https://github.com/spring-projects/spring-petclinic).

Added to `application.properties`
```
...
management.endpoints.enabled-by-default=true
...
```
This projects `properties.conf`
```json
{
"URL_BASE": "http://localhost:8080",
"MAPPING_ENDPOINT": "/actuator/mappings",
"CLASS_PREFIX": "org.springframework.samples.petclinic",
"OUTPUT_FILE_NAME": "diagram.png"
}
```
## Settings
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
## Running
Spring app needs to be running
```shell
$> bundle install
$> rake run
```
## Testing
Not implemented yet. As this is more excercise project then an enterprise ready solution. but you can run `rake lint`
## ToDo
- how to add metadata like method, params, etc.?
- clean up the code
- add tests