spec: publish the OpenAPI description, and keep it synced - #36
Merged
Merged
Conversation
The gateway has served an OpenAPI 3.1 description at api.greencalculus.com/openapi.json for some time. It is what postman/generate.py already reads. But nothing could discover it: it is in no repository, and it is not linked from the developer docs. A spec that tools cannot find is, for most purposes, a spec that does not exist — which is the point src/openapi.ts makes upstream about a capability missing from the machine-readable contract, applied one level out. GitHub code search, API directories, codegen and coding assistants all look for a file. - spec/openapi.json — 26 paths, re-serialised with sorted keys and 2-space indent so a diff is a contract change rather than key-order churn from the gateway. - spec/README.md — what it is, that the gateway is the authority, and codegen one-liners against both the live URL and the mirror. - .github/workflows/openapi-sync.yml — refetches every Monday and commits on change. A committed copy of a remote truth is a stale copy waiting to happen unless something re-reads the remote on a schedule. The sync job refuses a response that parses but is not a spec, so an error page or an edge-cache stub cannot overwrite a good mirror. Verified: an error-page JSON is refused, a 1-path stub is refused, the real spec is accepted. The fetch step was executed locally rather than eyeballed — it runs clean and reproduces the committed file byte for byte, so the weekly job will commit only on a real change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NRueWxopDXHoWY2dPvsmLG
This was referenced Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gateway has served an OpenAPI 3.1 description at
https://api.greencalculus.com/openapi.jsonfor some time — it is already whatpostman/generate.pyreads. Nothing could discover it. It is in no repository, and it is not linked from the developer docs.A spec that tools cannot find is, for most purposes, a spec that does not exist — the point
src/openapi.tsmakes upstream about a capability missing from the machine-readable contract, one level out. GitHub code search, API directories, codegen and coding assistants all look for a file.What's here
spec/openapi.jsonspec/README.md.github/workflows/openapi-sync.ymlREADME.mdWhy a sync job rather than a one-off copy
A committed copy of a remote truth is a stale copy waiting to happen unless something re-reads the remote on a schedule. So something does.
The job refuses a response that parses but is not a spec — an error page or an edge-cache stub would otherwise overwrite a good mirror with something worse than nothing:
{"error": "bad gateway"}{"openapi":"3.1.0","paths":{"/v1/health":{}}}Verification
The fetch step was extracted from the YAML and executed, not eyeballed — an embedded heredoc inside a block scalar is exactly the thing that only fails at runtime. It runs clean and reproduces the committed file byte for byte, so the weekly job commits only on a real change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NRueWxopDXHoWY2dPvsmLG