Skip to content

Re-introduce auto-generated OpenAPI for governance endpoints - #8147

Draft
Eddy Ashton (eddyashton) wants to merge 4 commits into
mainfrom
agents/openapi-auto-gen-restoration-gov
Draft

Re-introduce auto-generated OpenAPI for governance endpoints#8147
Eddy Ashton (eddyashton) wants to merge 4 commits into
mainfrom
agents/openapi-auto-gen-restoration-gov

Conversation

@eddyashton

Copy link
Copy Markdown
Member

This pull request implements the auto-generation of OpenAPI documentation for governance endpoints, enhancing the existing API structure. Key changes include:

  • Introduced a new ApiVersion::Latest to allow /gov/api and /gov/api?api-version=latest to return generated OpenAPI 3.0 documents.
  • Updated the GovEndpointRegistry to support the new versioning and ensure backward compatibility with dated versions.
  • Added comprehensive request and response metadata for all governance-specific endpoints, removing previous restrictions on OpenAPI visibility.
  • Created a new gov_openapi.json schema file containing the generated API structure.
  • Updated the changelog to reflect the new version 7.0.13 and included necessary documentation updates.

Validation has been completed successfully, ensuring that all changes are functional and meet the required standards.

@eddyashton
Eddy Ashton (eddyashton) requested a review from a team as a code owner August 12, 2026 12:38
Copilot AI lite review requested due to automatic review settings August 12, 2026 12:38
@eddyashton Eddy Ashton (eddyashton) changed the title Introduce auto-generated OpenAPI for governance endpoints Re-introduce auto-generated OpenAPI for governance endpoints Aug 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::Latest and updated governance endpoint version-selection so missing api-version selects latest.
  • 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.

Comment thread tests/schema.py Outdated
Comment thread tests/governance_api.py
Comment thread src/node/gov/gov_endpoint_registry.h
Comment thread CHANGELOG.md Outdated
@eddyashton
Eddy Ashton (eddyashton) marked this pull request as draft August 12, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants