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/steps/spec.md.

spec

The spec step serves the precompiled OpenAPI 3.1 specification document in JSON or YAML format. It is a terminal step that completes the request pipeline.

route "GET /openapi.json" {
  spec {
    format = "json"
  }
}

route "GET /openapi.yaml" {
  spec {
    format = "yaml"
  }
}

Attributes

AttributeTypeDefaultDescription
formatstring"json"Output encoding: "json" or "yaml"

ETag caching

Specifications are precomputed at boot time and hashed with SHA-256. Incoming requests containing a matching If-None-Match header receive an instant 304 Not Modified response without regenerating or re-transmitting the document.