O'Reilly logo

Hands-On Enterprise Java Microservices with Eclipse MicroProfile by Scott Stark, Antoine Sabot-Durand, Pavol Loffay, Jeff Mesnil, Heiko W. Rupp, Cesar Saavedra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming model

You can provide OpenAPI elements via Java POJOs (Plain Old Java Objects) by using the MicroProfile OpenAPI programming model. The complete set of models is described in the org.eclipse.microprofile.openapi.models package. You can read more about it at https://github.com/eclipse/microprofile-open-api/tree/master/api/src/main/java/org/eclipse/microprofile/openapi/models.

You can create an OpenAPI tree by using OASFactory. Refer to the following code block by way of an example:

OASFactory.createObject(Info.class).title("Weather")          .description("Weather APIs").version("1.0.0");

To bootstrap the OpenAPI model tree, you can use the OASModelReader interface. You can then create an implementation of this interface and register it ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required