Documentation
¶
Overview ¶
Package apispec embeds Cloudflare's official OpenAPI spec and a compact, generated table of every API operation in it (ops_gen.go).
Regenerate the table with `go generate ./...`; refresh the vendored spec with `make spec` (scripts/update-spec.sh).
Index ¶
Constants ¶
const ( SpecRepo = "https://github.com/cloudflare/api-schemas" SpecCommit = "37e7a4ae9c5123a2c58929a100c42cb4584edc57" SpecDate = "2026-10-02T19:35:42+00:00" SpecOpenAPI = "3.0.3" SpecVersion = "4.0.0" )
Spec source, recorded by `go run ./gen -import`.
Variables ¶
This section is empty.
Functions ¶
func Describe ¶
Describe renders a human-readable description of an operation: method, path, params, and request body schema with an example skeleton.
func Spec ¶
Spec returns the parsed embedded OpenAPI document (parsed once, lazily; ~13 MB of JSON, so only describe-style commands should need it).
Types ¶
type Op ¶
type Op struct {
// ID is the OpenAPI operationId (unique).
ID string
Method string
// Path is the templated path under /client/v4, e.g. /zones/{zone_id}/dns_records.
Path string
// Tag is the operation's first OpenAPI tag; TagSlug its CLI name.
Tag, TagSlug string
// Slug is the operation's CLI name, unique within TagSlug.
Slug string
Summary string
// Desc is the first line of the description.
Desc string
Deprecated bool
// Confirm is set when the spec marks the operation as needing confirmation
// (x-forge-require-confirmation).
Confirm bool
// Params: path params in path order, then query, header, cookie.
Params []Param
// BodyTypes lists request body content types, most CLI-friendly first.
BodyTypes []string
BodyRequired bool
}
Op is one Cloudflare API operation (an OpenAPI path + method).
func Search ¶
Search returns operations matching every word (case-insensitive) in operationId, summary, path, tag, or slugs.
func (*Op) HeaderParams ¶
HeaderParams returns the header parameters.
func (*Op) PathParams ¶
PathParams returns the path parameters in path order.
func (*Op) QueryParams ¶
QueryParams returns the query parameters.
type Param ¶
type Param struct {
Name string
// In is "path", "query", "header", or "cookie".
In string
// Type is the JSON schema type: string, integer, number, boolean,
// object, or array<T>.
Type string
Required bool
Enum []string
Default string
// Desc is the first line of the parameter's description.
Desc string
}
Param is one operation parameter.