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

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 ?

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay