use of org.wildfly.swarm.microprofile.openapi.api.OpenApiDocument in project wildfly-swarm by wildfly-swarm.
the class OpenApiDeploymentProcessor method process.
/**
* Process the deployment in order to produce an OpenAPI document.
*
* @see org.wildfly.swarm.spi.api.DeploymentProcessor#process()
*/
@Override
public void process() throws Exception {
try {
// First register OpenApiServletContextListener which triggers the final init
WARArchive warArchive = archive.as(WARArchive.class);
warArchive.findWebXmlAsset().addListener(LISTENER_CLASS);
} catch (Exception e) {
throw new RuntimeException("Failed to register OpenAPI listener", e);
}
// Set models from annotations and static file
OpenApiDocument openApiDocument = OpenApiDocument.INSTANCE;
openApiDocument.config(config);
openApiDocument.modelFromStaticFile(modelFromStaticFile());
openApiDocument.modelFromAnnotations(modelFromAnnotations());
}
use of org.wildfly.swarm.microprofile.openapi.api.OpenApiDocument in project wildfly-swarm by wildfly-swarm.
the class OpenApiServletContextListener method contextInitialized.
@Override
public void contextInitialized(ServletContextEvent sce) {
// Instantiate OASModelReader and OASFilter
OpenApiDocument openApiDocument = OpenApiDocument.INSTANCE;
openApiDocument.modelFromReader(modelFromReader());
openApiDocument.filter(getFilter());
// Now we're ready to initialize the final model
openApiDocument.initialize();
}
Aggregations