Class OpenApiDocument

java.lang.Object
io.helidon.openapi.OpenApiDocument

public final class OpenApiDocument extends Object
Version-neutral OpenAPI document model.

The model is based on the latest supported OpenAPI shape. Version implementations render this model to their target OpenAPI version, omitting or translating some fields that do not exist in that target version. They do not provide complete conversion between OpenAPI versions. Callers must select a target version compatible with the features used in the document.

  • Method Details

    • builder

      public static OpenApiDocument.Builder builder()
      Create a new builder.
      Returns:
      builder
    • openapi

      public Optional<String> openapi()
      OpenAPI specification version declared by this document.
      Returns:
      OpenAPI version
    • self

      public Optional<String> self()
      Document identity URI.

      A relative identity is resolved against the configured OpenAPI web context. When the identity is relative, Helidon cannot determine whether an absolute reference identifies this document because composition does not have the request scheme or authority. That combination is not supported; use an absolute document identity or relative references instead.

      Returns:
      document identity URI
    • jsonSchemaDialect

      public Optional<String> jsonSchemaDialect()
      JSON Schema dialect URI.
      Returns:
      JSON Schema dialect URI
    • info

      Info object.
      Returns:
      info object
    • servers

      public List<OpenApiDocument.Server> servers()
      Servers.
      Returns:
      servers
    • paths

      Path items keyed by OpenAPI path template.
      Returns:
      path items
    • webhooks

      public Map<String, OpenApiDocument.PathItem> webhooks()
      Webhooks keyed by name.
      Returns:
      webhooks
    • components

      public Optional<OpenApiDocument.Components> components()
      Components object.
      Returns:
      components object
    • securityRequirements

      public List<OpenApiDocument.SecurityRequirement> securityRequirements()
      Security requirements.
      Returns:
      security requirements
    • tags

      public List<OpenApiDocument.Tag> tags()
      Document tags.
      Returns:
      tags
    • externalDocs

      public Optional<OpenApiDocument.ExternalDocs> externalDocs()
      External documentation.
      Returns:
      external documentation
    • isEmpty

      public boolean isEmpty()
      Whether this document has no model content.
      Returns:
      whether this document is empty
    • toJsonObject

      public JsonObject toJsonObject()
      Convert this document model to a structured JSON object.
      Returns:
      JSON object representation of this document