specgen

command
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Command specgen turns the fulfillmenttools OpenAPI spec into opmeta.gen.go: the metadata table that lets fft reach every operation the typed client does not have.

oapi-codegen generates a typed client for eight tags — 95 methods of the API's 568 operations. The other 473 have no Go method to call, so a command that wants to reach them has to build the request itself: method, path template, parameters and body. That is what this table carries.

It also carries something the spec does not: a **sample request body** for each of the 281 operations that take one. The spec has thousands of field-level `example:` values and not a single request-body example, so there is nothing to copy; the bodies are synthesized from the schemas (see sample.go).

Run it through `make generate`. CI re-runs it and fails on a diff, so the output must be a deterministic function of the spec.

go run ./tools/specgen -spec api/openapi/fft.api.swagger.yaml -out internal/api/opmeta.gen.go

Jump to

Keyboard shortcuts

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