Class OpenApiProcessor


  • public class OpenApiProcessor
    extends Object
    Provides some core archive processing functionality.
    Author:
    eric.wittmann@gmail.com
    • Method Detail

      • 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 file
        staticFile - 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 an OpenAPI 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 - OpenApiConfig
        index - 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 an OpenAPI 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 - OpenApiConfig
        loader - ClassLoader to discover AnnotationScanner services (via ServiceLoader) as well as loading application classes
        index - 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 an OpenAPI 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 - OpenApiConfig
        loader - ClassLoader to load application classes
        index - IndexView of Archive
        scannerSupplier - 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)
        Instantiate the configured OASModelReader 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, a OpenApiRuntimeException is thrown.
        Parameters:
        config - OpenApiConfig
        loader - 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 configured OASModelReader 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, a OpenApiRuntimeException is thrown.
        Parameters:
        config - OpenApiConfig
        loader - ClassLoader
        index - an IndexView to be provided to the filter when accepted via its constructor
        Returns:
        OpenApiImpl created from OASModelReader
      • getFilter

        public static org.eclipse.microprofile.openapi.OASFilter getFilter​(OpenApiConfig config,
                                                                           ClassLoader loader,
                                                                           org.jboss.jandex.IndexView index)
        Instantiate the OASFilter configured by the application.
        Parameters:
        config - OpenApiConfig
        loader - ClassLoader
        index - 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 the OASFilter from a class name.
        Parameters:
        className - the filter impl class name
        loader - ClassLoader
        index - an IndexView to be provided to the filter when accepted via its constructor
        Returns:
        OASFilter instance retrieved from loader