DEV Community

Cover image for Documents Spring Boot actuator endpoint with OpenApi
Michèle for opt-nc

Posted on • Edited on

6

Documents Spring Boot actuator endpoint with OpenApi

In my previous post, I shown how to create a custom Spring Boot actuator endpoint. It could be useful to have pretty web interface to document these endpoints and allow other people to easily access your api in a pretty way. You know, I'm a girl, I like pretty things ;)

So, I chosen to use OpenApi which is usually easy to use, usually... In fact, by default, actuator endpoint are not shown with OpenApi, and it was hard to find how to do. That's why I decide to write this small post.

First of all, you'll need this dependencies :

    implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.5.0'
    implementation group: 'org.springdoc', name: 'springdoc-openapi-data-rest', version: '1.5.0'
Enter fullscreen mode Exit fullscreen mode

Then, you just need to add these properties...

springdoc:
  show-actuator: true
Enter fullscreen mode Exit fullscreen mode

... And you got your actuator endpoint documentation !

Alt Text

... And you can test your endpoints

Alt Text

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (1)

Collapse
 
adriens profile image
adriens

Could you put the link to your "previous post" as a href at the top of this post please ?

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay