vendorspec

command
v0.5.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2026 License: PostgreSQL Imports: 11 Imported by: 0

Documentation

Overview

Command vendorspec captures the published per-product OpenAPI contracts into openapi/. It is the engine behind `make vendor-spec`.

Each contract is served unauthenticated at {base}/{product}/v1/openapi.json, already filtered to the public, enterprise-maximal surface by the API itself, so what this tool fetches IS the public contract and nothing here derives or filters.

go run ./cmd/vendorspec -out openapi
go run ./cmd/vendorspec -out openapi -check

-base defaults to production because the vendored contract must be the one customers are served (TestVendoredSpecsAreCanonical pins the vendored servers URL there). -check reports drift without writing; a servers block that differs is a note, not drift, so a check against another environment still answers for paths and schemas. Both modes hit the network, so neither runs in CI.

Every product is validated before any file is written, and three things abort the run: an `x-pgedge-*` key anywhere (the upstream filter regressed); `x-go-type-import`, which names a package inside the API server's module that this module cannot import (a bare `x-go-type` naming UUID is expected, and each module's api/types.go supplies it); and a path outside the product's own namespace.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL