This module defines RestComponent that is responsible for:
@OpenAPIInclude annotation at compile timeDuring the build time, the Open API spec is generated from all API definitions that are included in @OpenAPIInclude annotation. The spec is located in ignite-rest/openapi.
ignite-rest-api moduleRestComponent's @OpenAPIInclude sectionExceptionHandler and include it in the micronaut factoryThe class that implements the API should be a valid micronaut controller. Module with the API implementation should configure
micronaut-inject-javaannotation processor.
Micronaut factories have to implement
RestFactoryfromignite-rest-api
RestFactory implementation ClusterManagementRestFactoryExceptionHandler implementation ClusterNotInitializedExceptionHandlerignite-rest-api module defines only API without any implementation. The main value of this module is to provide all needed information to generate an Open API spec.
REST server is started by RestComponent in ignite-rest module. This module also configures micronaut-openapi generator and generates an Open API spec during the build time. But the only dependency of the ignite-rest is ignite-rest-api. There is no dependency on any module that provides API implementation.
REST Controllers together with RestFactories are set to RestComponent at runtime by IgniteImpl through the constructor.
Unit tests can be defined at the same module where the Controller is implemented, see ClusterConfigurationControllerTest. To make them work test dependencies should include micronaut-test-junit5, micronaut-http-client, micronaut-http-server-netty. Also, micronaut-inject-java annotation processor should be configured.
Integration tests could be defined in runner module, see ItInitializedClusterRestTest and ItNotInitializedClusterRestTest.