Every Friday, Platform.sh has a nice tech discussion about several discussions, such as Jakarta EE, Payara, Quarkus, and so on (To check the calendar you can click here). On Episode number 15 there was a great discussion about Open API and Postman. That’s worth watching if you don’t yet.

To absorb that knowledge and practice what we learned from this episode, let’s create a Hello world Open API and then test it with Postman. We’ll create a small Java API that will handle all Deploy-Fridays episodes and store it on MongoDB. Why do we want to use MongoDB? Just because we’re hipsters!!

We’re going to be using Eclipse MicroProfile. This will make our life easier when we want to create a microservices application. In this tutorial, we’ll use Helidon version 2.0. To integrate with a NoSQL database let’s use Jakarta NoSQL.

Eclipse MicroProfile has a subproject to integrate with Open API that’s annotation-driven.

Let’s start with the entities; remember that those entities will also be the data inputs, so we’ll define them as a schema.

As you can see in the code, beyond the Eclipse MicroProfile Open API annotations, there are also the Jakarta NoSQL entities annotations and JSON Binding to check the fields instead of methods.

#java #microprofile #openapi #postman #helidon

Get More Transparency on Your Microservices API With OpenAPI
1.05 GEEK