For AI agents: the complete documentation index is available at /hclapi/llms.txt, the full documentation bundle is available at /hclapi/llms-full.txt, and this page is available as Markdown at /hclapi/openapi/configuration.md.

OpenAPI configuration

OpenAPI document metadata, target servers, tags, and endpoint handler options are configured using standard HCL blocks.

Global specification metadata (server.openapi {})

Declared inside server {} to configure the global document header:

server {
  host = "0.0.0.0"
  port = 8080

  openapi {
    title   = "Acme Storefront API"
    version = "1.2.0"

    description = <<-MARKDOWN
      ## Overview
      Production customer account and order management API service.

      ### Authentication
      Most endpoints require a valid API key passed via the `X-API-Key` header.
    MARKDOWN

    servers = [
      {
        url         = "https://api.example.com/v1"
        description = "Production cluster"
      },
      {
        url         = "http://localhost:8080"
        description = "Local development server"
      }
    ]

    tags = [
      {
        name        = "users"
        description = "Customer accounts, authentication, and profiles"
      },
      {
        name        = "orders"
        description = "Order checkout, cart mutations, and payment history"
      }
    ]

    contact {
      name  = "API Engineering"
      email = "support@example.com"
      url   = "https://example.com/developers"
    }

    license {
      name = "MIT"
      url  = "https://opensource.org/licenses/MIT"
    }
  }
}

Global metadata attributes (server.openapi)

AttributeTypeDefaultDescription
titlestring"API Documentation"Human-readable title in OpenAPI info.title
versionstring"1.0.0"API version in OpenAPI info.version
descriptionstring""Multi-line Markdown description in OpenAPI info.description
serverslist(object)[]List of deployment servers (url, description)
tagslist(object)[]List of category tags for operation grouping (name, description)
contactblocknullContact information (name, email, url)
licenseblocknullLegal license information (name, url)

Endpoint handler attributes (endpoint.openapi)

Declared inside an endpoint block to serve a documentation UI or raw specification:

AttributeTypeDefaultDescription
uistring"scalar"Built-in UI renderer: "scalar", "elements", "swagger", "redoc"
formatstringnullRaw specification output format: "json" or "yaml"
spec_urlstringAuto-derivedURL path to the OpenAPI specification to load
templatestring""Custom HTML template string (heredoc)
template_filestring""Path to custom HTML template file relative to manifest