Skip to content

docs: propose sub-issues for multi-version API support plan (#1937)#1938

Merged
pmcelhaney merged 2 commits intomainfrom
copilot/add-multiple-version-support
Apr 25, 2026
Merged

docs: propose sub-issues for multi-version API support plan (#1937)#1938
pmcelhaney merged 2 commits intomainfrom
copilot/add-multiple-version-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 25, 2026

Summary

Issue #1937 asks for a documented implementation plan for multi-version API support (e.g. group: my-api, version: v1 + group: my-api, version: v2 mounted at /<group>/<version>). This PR adds eight focused issue proposal files under .github/issue-proposals/ — one per subsystem — that will be automatically converted into GitHub sub-issues on merge.

Original Prompt

Given a spec like the following:

spec:
  - source: ./specs/my-api-v1.yaml
    group: my-api
    version: v1
  - source: ./specs/my-api-v2.yaml
    group: my-api
    version: v2
destination: out

Counterfact should load both versions of the API. The server should host the APIs at /<group>/<version>. For the most part, the generated code supporting these two APIs will be shared. TypeCoders except for OperationTypeCoder will put their output in subdirectories according to the version property passed into them. (SchemaTypeCoder and ResponseTypeCoder already do that; the others will need to be updated.)

OperationTypeCoder will output code that maps to each of the versions. A Versioned type will be created in a new file under ./out/types/versions.ts.

Create an issue that documents the overall approach for implementing multiple version support, including what changes will need to be made in the server, code generator, core / app code, the REPL, the scenarios, the documentation, etc. Do not write any code yet.

Manual acceptance tests

  • All proposal files have valid YAML front matter with non-empty title and body
  • Each proposal references parentIssue: 1937
  • Each proposal has a Markdown checklist of acceptance criteria
  • Proposals collectively cover all subsystems: config, server, code generator, REPL, scenarios, and docs
  • No proposal mentions the Petstore specifically — examples use generic API names

Tasks

  • Added config-add-version-field-to-spec-config.md — add optional version to SpecConfig; relax duplicate-group validation when versions differ
  • Added server-route-group-version-url-prefixes.md — auto-derive /<group>/<version> prefix; keep explicit prefix override
  • Added generator-version-subdirectories-for-remaining-coders.md — update ParametersTypeCoder, ResponsesTypeCoder, ParameterExportTypeCoder to mirror the types/<version>/… layout already used by SchemaTypeCoder and ResponseTypeCoder
  • Added generator-operation-type-coder-version-map.md — emit per-version $-argument types under types/<version>/ and a shared HTTP_<METHOD> wrapper using Versioned<…> at the shared path
  • Added generator-emit-versions-ts.md — generate types/versions.ts with Versions union, VersionsGTE ordering map, and Versioned<T> utility type
  • Added repl-version-aware-context-routes-scenario.md — extend context.<group>.<version>, .scenario <group> <version> <path>, and tab completion
  • Added scenarios-version-aware-loading.md — version-scoped scenario directory resolution with shared fallback; expose $.version in startup scenario
  • Added docs-multiple-version-support.md — new docs/features/multiple-versions.md plus updates to usage.md, reference.md, and type JSDoc

Copilot AI linked an issue Apr 25, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add support for multiple versions of Petstore API docs: propose sub-issues for multi-version API support plan (#1937) Apr 25, 2026
Copilot AI requested a review from pmcelhaney April 25, 2026 13:19
@pmcelhaney pmcelhaney marked this pull request as ready for review April 25, 2026 14:35
@pmcelhaney pmcelhaney enabled auto-merge April 25, 2026 14:35
@pmcelhaney pmcelhaney added this pull request to the merge queue Apr 25, 2026
Merged via the queue into main with commit 90fe29f Apr 25, 2026
7 of 10 checks passed
@pmcelhaney pmcelhaney deleted the copilot/add-multiple-version-support branch April 25, 2026 14:42
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.

Multiple Version Support Plan

2 participants