Interface OpenApiDocumentSource

All Known Implementing Classes:
OpenApiSourceBase

@Contract public interface OpenApiDocumentSource
Source of generated OpenAPI document metadata.

A source can be qualified with @Service.Named so the OpenAPI feature can select it with generated.document-sources. Unqualified sources always contribute when they support the document context and cannot be filtered by generated.document-sources.

The final composed OpenAPI document must contain Info metadata. The metadata can be contributed by a custom source, generated from an application type annotated with @OpenApi.Document and @OpenApi.Info, or supplied by static OpenAPI content when static and generated content are merged. An individual source does not need to provide Info metadata if another contribution supplies it.

  • Method Details

    • supports

      default boolean supports(OpenApiDocumentContext context)
      Whether this source contributes to the provided document context.
      Parameters:
      context - document context
      Returns:
      true if this source should contribute
    • describe

      void describe(OpenApiDocumentContext context, OpenApiDocument.Builder document)
      Describe this source as OpenAPI document metadata.
      Parameters:
      context - document context
      document - document builder