gen-openapi

command
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Command gen-openapi converts the swaggo-generated Swagger 2.0 document (docs/swagger.json) into a clean OpenAPI 3.0.3 document written to api/openapi.yaml.

This is the versioned contract other services (notably the paper CLI, which generates a Rust client with progenitor) consume. progenitor + openapiv3 are OpenAPI 3.0.x-only and require an operationId on every operation, so this tool:

  • converts 2.0 -> 3.0.3 in-process via kin-openapi (no Node toolchain),
  • forces the version string to 3.0.3,
  • synthesizes a deterministic operationId for any operation still missing one (belt-and-suspenders: the handlers carry @ID annotations, but a future un-annotated handler must not be able to break downstream codegen),
  • strips swag's package prefixes from component schema names (and rewrites every $ref) so the generated Rust types read as SessionItem rather than ApiSessionItem, with a collision guard that keeps the qualified name when two packages would otherwise collapse onto the same bare name.

Run via `make openapi` (which runs `make swag` first). Do not edit the output by hand.

Jump to

Keyboard shortcuts

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