OpenAPI root document: root path item, rpc produces, default host/schemes (#85) - #87
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PostgREST v14.12 inserts a GET-only Introspection path item for / ( makeRootPathItem, OpenAPI.hs#L370-379) and stamps every RPC operation with produces [json, vnd.pgrst.object+json;nulls=stripped, vnd.pgrst.object+json] (OpenAPI.hs#L360). Issue #85 items 1-2. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…roxy postgrestSpec unconditionally renders the scheme/host/port/basePath block, falling back to (http, server-host, port, /) when no openapi-server-proxy-uri is set, with listen-anywhere hosts escaped to 0.0.0.0 and the port always appended - including scheme-default proxy ports, removing our omit-default-port deviation (OpenAPI.hs#L393-454, Network.hs#L46-52). Issue #85 item 3. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
postgrestSpec stamps the Swagger root with equal produces and consumes lists - the rpc trio plus text/csv (OpenAPI.hs#L408-409). Uncased gap discovered while verifying #85; bundled here on operator approval (plan amendment Task 2b). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolves the build_openapi_document conflict by combining both sides: the server_scheme/server_host/server_port build inputs from this branch plus the openapi_version 3.0 conversion gate from #84. Semantic follow-through for the merge: the V3 converter now drops the 2.0-only operation-level produces lists this branch added (its 3.0 output stays application/json-only per its moduledoc), and the #84 unit tests are updated to the emitter's new required server inputs and the always-present schemes/host/basePath server URL. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #85. All three wire gaps verified against PostgREST v14.12 sources (
Response/OpenAPI.hs,Network.hs,MediaType.hs, swagger2'sToJSON Host), plus one bundled gap discovered during verification."/"path item —pathsnow carries the GET-only Introspection entry (tags["Introspection"], summary "OpenAPI description (this document)",produces: [application/openapi+json, application/json]) permakeRootPathItem(OpenAPI.hs#L370-379).produceslist — every/rpc/*GET and POST operation advertises[application/json, application/vnd.pgrst.object+json;nulls=stripped, application/vnd.pgrst.object+json]perprocOp(OpenAPI.hs#L360, MediaType.hs#L72-74).schemes/host/basePath—postgrestSpecalways renders the block; without a proxy it falls back to the server config (proxyUri, OpenAPI.hs#L448-454), with listen-anywhere hosts escaped to0.0.0.0(Network.hs#L46-52) and the port always appended tohost(swagger2Host h (Just p)→"h:p"). This also removes a pre-existing deviation: Bier used to omit scheme-default ports from proxy hosts, butpickProxyfills 80/443 and the port is always rendered (OpenAPI.hs#L414, L441-446). One PostgREST-intentional divergence, noted in a code comment: PostgREST hardcodes schemehttpin the fallback (no native TLS); Bier followsrouter[:scheme], which matches PostgREST's wire output for the default:http.produces/consumesof[application/json, application/vnd.pgrst.object+json;nulls=stripped, application/vnd.pgrst.object+json, text/csv](OpenAPI.hs#L408-409) — uncased gap found while verifying the above; plan amendment Task 2b.Safety vs the frozen suite: every OpenAPI conformance case asserts via
body_jsonpath, and noabsent:predicate targets$.paths['/'],produces,consumes,host, orschemes— additive keys can't break them. Full suite +mix precommitgreen (902 tests).Plan:
docs/superpowers/plans/2026-07-16-issue-85-openapi-wire-gaps.md🤖 Generated with Claude Code