vendorspec

command
v0.5.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 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 (saas #1920), already filtered to the public, enterprise-maximal surface by saas's own GeneratePublicSpec — 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 fetches and reports drift without writing, and compares the contract rather than the host: a servers block that differs is printed as a note, not counted as drift, so a check against another environment answers for its paths and schemas. Both modes hit the network, so neither runs in CI.

The tool is still fail-closed, in three ways, and every product is validated before any file is written: an `x-pgedge-*` key anywhere in a published contract aborts the run (the upstream filter should have removed it, so one appearing means that filter regressed); so does `x-go-type-import`, which names a saas-internal package this module cannot import (a bare `x-go-type` is expected — it names UUID, which each module's api/types.go supplies); and so does 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