Class BasicOpenApiProvider

java.lang.Object
org.apache.juneau.rest.server.openapi.BasicOpenApiProvider
All Implemented Interfaces:
OpenApiProvider

public class BasicOpenApiProvider extends Object implements OpenApiProvider
Basic implementation of an OpenApiProvider.

Default provider used by RestContext when no override is configured. Creates a fresh BasicOpenApiProviderSession per call, which walks the @Rest / @RestOp annotation graph and emits an OpenApi 3.1 document.

See Also:
  • Constructor Details

    • BasicOpenApiProvider

      public BasicOpenApiProvider(BeanStore beanStore)
      Constructor.
      Parameters:
      beanStore - The bean store containing injectable beans for this provider.
      Must not be null.
    • BasicOpenApiProvider

      Constructor.
      Parameters:
      builder - The builder containing the settings for this OpenAPI provider.
      Must not be null.
  • Method Details

    • getOpenApi

      public OpenApi getOpenApi(RestContext context, Locale locale) throws Exception
      Returns the OpenAPI 3.1 document associated with the specified context of a Rest-annotated class.

      Subclasses can override this to provide their own method for generating the document.

      Specified by:
      getOpenApi in interface OpenApiProvider
      Parameters:
      context - The context of the Rest-annotated class.
      locale - The request locale.
      Returns:
      A new OpenApi object.
      Throws:
      Exception - If an error occurred producing the document.