Package io.smallrye.openapi.runtime
Class OpenApiProcessor
java.lang.Object
io.smallrye.openapi.runtime.OpenApiProcessor
Provides some core archive processing functionality.
- Author:
- [email protected]
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.microprofile.openapi.models.OpenAPI
bootstrap
(OpenApiConfig config, org.jboss.jandex.IndexView index) static org.eclipse.microprofile.openapi.models.OpenAPI
bootstrap
(OpenApiConfig config, org.jboss.jandex.IndexView index, OpenApiStaticFile... staticFiles) static org.eclipse.microprofile.openapi.models.OpenAPI
bootstrap
(OpenApiConfig config, org.jboss.jandex.IndexView index, ClassLoader classLoader) static org.eclipse.microprofile.openapi.models.OpenAPI
bootstrap
(OpenApiConfig config, org.jboss.jandex.IndexView index, ClassLoader classLoader, OpenApiStaticFile... staticFiles) static org.eclipse.microprofile.openapi.models.OpenAPI
bootstrap
(org.jboss.jandex.IndexView index) static org.eclipse.microprofile.openapi.OASFilter
getFilter
(OpenApiConfig config, ClassLoader loader) Deprecated.use getFilter(OpenApiConfig, ClassLoader, IndexView) insteadstatic org.eclipse.microprofile.openapi.OASFilter
getFilter
(OpenApiConfig config, ClassLoader loader, org.jboss.jandex.IndexView index) Instantiate theOASFilter
configured by the application.static org.eclipse.microprofile.openapi.OASFilter
getFilter
(String className, ClassLoader loader, org.jboss.jandex.IndexView index) Instantiate theOASFilter
from a class name.static org.eclipse.microprofile.openapi.models.OpenAPI
modelFromAnnotations
(OpenApiConfig config, ClassLoader loader, org.jboss.jandex.IndexView index) Create anOpenAPI
model by scanning the deployment for relevant JAX-RS and OpenAPI annotations.static org.eclipse.microprofile.openapi.models.OpenAPI
modelFromAnnotations
(OpenApiConfig config, ClassLoader loader, org.jboss.jandex.IndexView index, Supplier<Iterable<AnnotationScanner>> scannerSupplier) Create anOpenAPI
model by scanning the deployment for relevant JAX-RS and OpenAPI annotations.static org.eclipse.microprofile.openapi.models.OpenAPI
modelFromAnnotations
(OpenApiConfig config, org.jboss.jandex.IndexView index) Create anOpenAPI
model by scanning the deployment for relevant JAX-RS and OpenAPI annotations.static org.eclipse.microprofile.openapi.models.OpenAPI
modelFromReader
(OpenApiConfig config, ClassLoader loader) Deprecated.static org.eclipse.microprofile.openapi.models.OpenAPI
modelFromReader
(OpenApiConfig config, ClassLoader loader, org.jboss.jandex.IndexView index) Instantiate the configuredOASModelReader
and invoke it.static org.eclipse.microprofile.openapi.models.OpenAPI
modelFromStaticFile
(OpenApiConfig config, OpenApiStaticFile staticFile) Parse the static file content and return the resulting model.static org.eclipse.microprofile.openapi.models.OpenAPI
modelFromStaticFile
(OpenApiStaticFile staticFile) Parse the static file content and return the resulting model.
-
Method Details
-
bootstrap
public static org.eclipse.microprofile.openapi.models.OpenAPI bootstrap(org.jboss.jandex.IndexView index) -
bootstrap
public static org.eclipse.microprofile.openapi.models.OpenAPI bootstrap(OpenApiConfig config, org.jboss.jandex.IndexView index) -
bootstrap
public static org.eclipse.microprofile.openapi.models.OpenAPI bootstrap(OpenApiConfig config, org.jboss.jandex.IndexView index, OpenApiStaticFile... staticFiles) -
bootstrap
public static org.eclipse.microprofile.openapi.models.OpenAPI bootstrap(OpenApiConfig config, org.jboss.jandex.IndexView index, ClassLoader classLoader) -
bootstrap
public static org.eclipse.microprofile.openapi.models.OpenAPI bootstrap(OpenApiConfig config, org.jboss.jandex.IndexView index, ClassLoader classLoader, OpenApiStaticFile... staticFiles) -
modelFromStaticFile
public static org.eclipse.microprofile.openapi.models.OpenAPI modelFromStaticFile(OpenApiConfig config, OpenApiStaticFile staticFile) Parse the static file content and return the resulting model. Note that this method does NOT close the resources in the static file. The caller is responsible for that.- Parameters:
config
- configuration used while reading the static filestaticFile
- OpenApiStaticFile to be parsed- Returns:
- OpenApiImpl
-
modelFromStaticFile
public static org.eclipse.microprofile.openapi.models.OpenAPI modelFromStaticFile(OpenApiStaticFile staticFile) Parse the static file content and return the resulting model. Note that this method does NOT close the resources in the static file. The caller is responsible for that.- Parameters:
staticFile
- OpenApiStaticFile to be parsed- Returns:
- OpenAPI model from the file
-
modelFromAnnotations
public static org.eclipse.microprofile.openapi.models.OpenAPI modelFromAnnotations(OpenApiConfig config, org.jboss.jandex.IndexView index) Create anOpenAPI
model by scanning the deployment for relevant JAX-RS and OpenAPI annotations. If scanning is disabled, this method returns null. If scanning is enabled but no relevant annotations are found, an empty OpenAPI model is returned.- Parameters:
config
- OpenApiConfigindex
- IndexView of Archive- Returns:
- OpenAPIImpl generated from annotations
-
modelFromAnnotations
public static org.eclipse.microprofile.openapi.models.OpenAPI modelFromAnnotations(OpenApiConfig config, ClassLoader loader, org.jboss.jandex.IndexView index) Create anOpenAPI
model by scanning the deployment for relevant JAX-RS and OpenAPI annotations. If scanning is disabled, this method returns null. If scanning is enabled but no relevant annotations are found, an empty OpenAPI model is returned.- Parameters:
config
- OpenApiConfigloader
- ClassLoader to discover AnnotationScanner services (via ServiceLoader) as well as loading application classesindex
- IndexView of Archive- Returns:
- OpenAPIImpl generated from annotations
-
modelFromAnnotations
public static org.eclipse.microprofile.openapi.models.OpenAPI modelFromAnnotations(OpenApiConfig config, ClassLoader loader, org.jboss.jandex.IndexView index, Supplier<Iterable<AnnotationScanner>> scannerSupplier) Create anOpenAPI
model by scanning the deployment for relevant JAX-RS and OpenAPI annotations. If scanning is disabled, this method returns null. If scanning is enabled but no relevant annotations are found, an empty OpenAPI model is returned.- Parameters:
config
- OpenApiConfigloader
- ClassLoader to load application classesindex
- IndexView of ArchivescannerSupplier
- supplier of AnnotationScanner instances to use to generate the OpenAPI model for the application- Returns:
- OpenAPI generated from annotations
-
modelFromReader
@Deprecated public static org.eclipse.microprofile.openapi.models.OpenAPI modelFromReader(OpenApiConfig config, ClassLoader loader) Deprecated.Instantiate the configuredOASModelReader
and invoke it. If no reader is configured, then return null. If a class is configured but there is an error either instantiating or invoking it, aOpenApiRuntimeException
is thrown.- Parameters:
config
- OpenApiConfigloader
- ClassLoader- Returns:
- OpenApiImpl created from OASModelReader
-
modelFromReader
public static org.eclipse.microprofile.openapi.models.OpenAPI modelFromReader(OpenApiConfig config, ClassLoader loader, org.jboss.jandex.IndexView index) Instantiate the configuredOASModelReader
and invoke it. If no reader is configured, then return null. If a class is configured but there is an error either instantiating or invoking it, aOpenApiRuntimeException
is thrown.- Parameters:
config
- OpenApiConfigloader
- ClassLoaderindex
- an IndexView to be provided to the filter when accepted via its constructor- Returns:
- OpenApiImpl created from OASModelReader
-
getFilter
@Deprecated public static org.eclipse.microprofile.openapi.OASFilter getFilter(OpenApiConfig config, ClassLoader loader) Deprecated.use getFilter(OpenApiConfig, ClassLoader, IndexView) insteadInstantiate theOASFilter
configured by the app.- Parameters:
config
- OpenApiConfigloader
- ClassLoader- Returns:
- OASFilter instance retrieved from loader
-
getFilter
public static org.eclipse.microprofile.openapi.OASFilter getFilter(OpenApiConfig config, ClassLoader loader, org.jboss.jandex.IndexView index) Instantiate theOASFilter
configured by the application.- Parameters:
config
- OpenApiConfigloader
- ClassLoaderindex
- an IndexView to be provided to the filter when accepted via its constructor- Returns:
- OASFilter instance retrieved from loader
-
getFilter
public static org.eclipse.microprofile.openapi.OASFilter getFilter(String className, ClassLoader loader, org.jboss.jandex.IndexView index) Instantiate theOASFilter
from a class name.- Parameters:
className
- the filter impl class nameloader
- ClassLoaderindex
- an IndexView to be provided to the filter when accepted via its constructor- Returns:
- OASFilter instance retrieved from loader
-