Re-introduce auto-generated OpenAPI for governance endpoints - #8147
Draft
Eddy Ashton (eddyashton) wants to merge 4 commits into
Draft
Re-introduce auto-generated OpenAPI for governance endpoints#8147Eddy Ashton (eddyashton) wants to merge 4 commits into
Eddy Ashton (eddyashton) wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds auto-generated OpenAPI 3.0 documentation for /gov governance endpoints, introducing a moving latest API alias (selected when api-version is omitted or explicitly set to latest) while preserving access to older dated schemas.
Changes:
- Added
ApiVersion::Latestand updated governance endpoint version-selection so missingapi-versionselectslatest. - Enabled OpenAPI generation for governance endpoints by adding request/response schema metadata and introducing governance-specific OpenAPI schema types.
- Added documentation + schema artifacts for the generated governance OpenAPI, and updated package/changelog versions.
Custom instructions used
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/schema.py | Extends schema-fetching test to validate and persist /gov/api schemas (including latest). |
| tests/infra/openapi.py | Adjusts OpenAPI request-body placeholder handling for COSE validation. |
| tests/infra/member.py | Adds a Latest governance API client variant. |
| tests/infra/e2e_args.py | Switches default --gov-api-version to latest. |
| tests/infra/consortium.py | Allows selecting the new latest governance API version. |
| tests/infra/clients.py | Introduces API_VERSION_LATEST and treats it like v1 for COSE header behavior. |
| tests/governance_api.py | Adds coverage for unversioned /gov reads and additional service-state endpoints. |
| src/node/gov/README.md | Updates governance API docs to describe latest selection and generated OpenAPI. |
| src/node/gov/handlers/transactions.h | Adds OpenAPI schema/summary metadata and routes Latest through the current implementation. |
| src/node/gov/handlers/service_state.h | Adds OpenAPI schema/summary metadata and routes Latest through the current implementation. |
| src/node/gov/handlers/recovery.h | Adds OpenAPI schema/summary metadata and routes Latest through the current implementation. |
| src/node/gov/handlers/proposals.h | Adds OpenAPI schema/summary metadata, routes Latest, and improves response content-type metadata. |
| src/node/gov/handlers/acks.h | Adds OpenAPI schema/summary metadata and routes Latest through the current implementation. |
| src/node/gov/gov_endpoint_registry.h | Sets governance OpenAPI metadata, generates latest OpenAPI, and serves frozen schemas for dated versions. |
| src/node/gov/api_version.h | Adds Latest, introduces a missing-version policy, and centralizes accepted-version checks. |
| src/node/gov/api_types.h | Adds governance-specific OpenAPI schema types used by endpoint registrations. |
| src/endpoints/test/endpoint_registry.cpp | Extends OpenAPI response content-type testing for JavaScript payloads. |
| python/pyproject.toml | Bumps Python package version to 7.0.13. |
| include/ccf/ds/openapi.h | Adds ds::openapi::Javascript content-type/schema support. |
| doc/schemas/gov_openapi.json | Adds generated governance OpenAPI 3.0 document artifact. |
| doc/governance/member_rpc_api.rst | Updates governance API docs to describe latest behavior and adds a latest schema page. |
| doc/governance/gov_api_schemas/latest.rst | New doc page embedding the generated governance OpenAPI. |
| CHANGELOG.md | Adds a 7.0.13 entry describing the governance latest API/OpenAPI behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Eddy Ashton (eddyashton)
marked this pull request as draft
August 12, 2026 14:34
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.
This pull request implements the auto-generation of OpenAPI documentation for governance endpoints, enhancing the existing API structure. Key changes include:
ApiVersion::Latestto allow/gov/apiand/gov/api?api-version=latestto return generated OpenAPI 3.0 documents.GovEndpointRegistryto support the new versioning and ensure backward compatibility with dated versions.gov_openapi.jsonschema file containing the generated API structure.7.0.13and included necessary documentation updates.Validation has been completed successfully, ensuring that all changes are functional and meet the required standards.