Repository navigation
Description
Summary
ADR 0029 (#1089) lists "a generated OpenAPI document and automated CommonGrants contract validation" in the support contract for each standalone API template. No template repository runs that validation today, and none can get a meaningful result from it yet:
cg check speccollapsesanyOfto its first member, ignoresoneOf, and does not handletypearrays ([CLI] Fix howresolveAnyOf()incg check specworks #735). It fails valid Zod-generated documents and passes nullable fields in Pydantic-generated documents as if they were non-nullable.- Core's published spec predates the ADR 0024 nullability decision ([Core] Resolve opportunity API nullability mismatches between SDKs and protocol #1192), so a template built on the current SDKs disagrees with the spec on every optional field even when the checker is right.
common-grants/cg-api-template-hono ships without a checker job (#1152). This issue owns automated contract validation for all three templates, and takes it out of the monorepo-removal gate: #1186 proceeds once the Express (#332) and FastAPI (#1183) repositories are verified against the rest of the support contract (named owner, SDK request and response validation, generated OpenAPI, tests against the supported SDK range). The checker work lands here once #735 and #1192 make its results meaningful.
The check runs in CI only. It must not add @common-grants/cli or its TypeSpec dependency graph to the template's runtime or development dependencies, because those ship into every project created from the template.
Acceptance criteria
- Each of
cg-api-template-hono,cg-api-template-express, andcg-api-template-fastapirunscg check specin CI against its own generated OpenAPI document - The job is advisory until one verified clean run per repository, then required
- The CLI is invoked from CI only; the template's
package.jsonorpyproject.tomldependencies are unchanged - The three repositories use the same job definition, or the differences are documented in each repository's
CONTRIBUTING.md - Any finding that remains after [CLI] Fix how
resolveAnyOf()incg check specworks #735 and [Core] Resolve opportunity API nullability mismatches between SDKs and protocol #1192 land is filed against its owning component before the job is made required - Restore the "Validate your spec" step in the TypeScript guide (
website/src/content/docs/guides/using-typescript.mdx) oncecg-api-template-honopassescg check spec. docs(website): start the TypeScript guide from the Hono template repository #1341 removed it because the template reports errors today.
Related
- ADR 0029 support contract: https://commongrants.org/governance/adr/0029-api-template-repositories/
- Checker defects: [CLI] Fix how
resolveAnyOf()incg check specworks #735 - Core nullability alignment: [Core] Resolve opportunity API nullability mismatches between SDKs and protocol #1192
- Templates: [Dev tool] Create a Hono.js API template #1152 (Hono), [Template] Create an Express.js API template #332 (Express), [Template] Extract and refresh the FastAPI template into a standalone repository #1183 (FastAPI)
- Monorepo removal: [Monorepo] Remove the root templates/ projects and their CI #1186
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
resolveAnyOf()incg check specworks #735docs(website): drop the spec check and TypeSpec steps from the TypeSc…
docs(website): drop the spec check and TypeSpec steps from the TypeSc…
docs(website): start the TypeScript guide from the Hono template repo…