use of fish.payara.microprofile.openapi.impl.processor.ConfigPropertyProcessor in project Payara by payara.
the class OpenAPISupplier method get.
@Override
public synchronized OpenAPI get() {
if (this.document != null) {
return this.document;
}
if (!enabled) {
return null;
}
try {
final Parser parser = Globals.get(ApplicationLifecycle.class).getDeployableParser(archive, true, true, StructuredDeploymentTracing.create(applicationId), Logger.getLogger(OpenApiService.class.getName()));
final Types types = parser.getContext().getTypes();
OpenAPI doc = new OpenAPIImpl();
try {
final List<URL> baseURLs = getServerURL(contextRoot);
doc = new ConfigPropertyProcessor().process(doc, config);
doc = new ModelReaderProcessor().process(doc, config);
doc = new FileProcessor(classLoader).process(doc, config);
doc = new ApplicationProcessor(types, filterTypes(archive, config, types), classLoader).process(doc, config);
doc = new BaseProcessor(baseURLs).process(doc, config);
doc = new FilterProcessor().process(doc, config);
} finally {
this.document = doc;
}
return this.document;
} catch (Exception ex) {
throw new RuntimeException("An error occurred while creating the OpenAPI document.", ex);
}
}
Aggregations