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/docs/manifest/openapi.md.

openapi

The openapi block configures global document metadata exported into your OpenAPI 3.1 specifications and documentation viewers.

openapi {
  title       = "Storefront API"
  version     = "1.2.0"
  description = "Customer account and order management services"

  servers = [
    {
      url         = "https://api.example.com/v1"
      description = "Production cluster"
    },
    {
      url         = "https://staging.api.example.com/v1"
      description = "Staging cluster"
    }
  ]

  tags = [
    {
      name        = "users"
      description = "User accounts and permissions"
    },
    {
      name        = "orders"
      description = "Cart updates and checkout"
    }
  ]

  contact {
    name  = "API Support"
    email = "support@example.com"
  }

  license {
    name = "Apache-2.0"
    url  = "https://www.apache.org/licenses/LICENSE-2.0"
  }
}

Top level attributes

AttributeTypeDefaultDescription
titlestring"API Documentation"Document title in info.title
versionstring"1.0.0"API semantic version in info.version
descriptionstring""Markdown description exported to info.description
serverslist(object)[{ url = "/" }]List of target deployment servers with url and optional description
tagslist(object)[]List of API tags with name and optional description

Nested blocks

server

Declares target deployment origins:

server {
  url         = "https://api.example.com/v1"
  description = "Production server"
}

If you don't declare any server block, hclapi defaults to url = "/". This keeps browser documentation portals like Scalar and Swagger on the exact same origin, so you won't run into CORS issues during local testing.

tag

Organizes routes into logical groups inside documentation portals:

tag {
  name        = "orders"
  description = "Cart updates and order checkout"
}

contact

contact {
  name  = "API Team"
  email = "api@example.com"
  url   = "https://example.com"
}

license

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