docs: document multi-version API support - #1993
Conversation
pmcelhaney
left a comment
There was a problem hiding this comment.
Move all information about types to the bottom of multiple-versions.md. Users don't need to know how the sausage is made, but leave it at the bottom in case they're interested.
Remove the section about using scenarios with groups, as groups are orthogonal to versions.
| |-------|----------|-------------| | ||
| | `source` | yes | Path or URL to the OpenAPI document | | ||
| | `group` | yes | Subdirectory name under `basePath`; must be non-empty and unique across groups (not across versions of the same group) | | ||
| | `version` | no | Version label (e.g. `"v1"`, `"v2"`). When set, the routes are mounted under `/<group>/<version>`. When omitted, routes are mounted under `/<group>`. | |
There was a problem hiding this comment.
Fixed in da29251 — changed version from no to yes in the field table.
Agent-Logs-Url: https://github.com/counterfact/api-simulator/sessions/deb5c3cd-fa12-4875-95ff-ef0b0423d1eb Co-authored-by: pmcelhaney <51504+pmcelhaney@users.noreply.github.com>
Done in da29251. Moved the "TypeScript narrowing with |
Multi-version API support had no user-facing documentation — users couldn't discover the feature or know how to configure it. This PR adds the missing docs across four areas.
Summary
New feature page —
docs/features/multiple-versions.mdgroup+versionfields), with a field reference table marking both as required/<group>/<version>/...prefixes are derivedroutes/, sharedtypes/paths/, per-versiontypes/<version>/, andtypes/versions.ts$.versionand$.minVersion()(generic "catalog" example, not tied to any real API)Versioned<T,V>andminVersion()as a type predicate) moved to the bottom of the page for readers who want to understand the underlying typesdocs/usage.md— added "Multiple versions" row to the features table.docs/reference.md— new "Multiple API versions" section documentingSpecConfig.version,Versioned<T,V>,Versions,VersionsGTE, andtypes/versions.tsexports.src/typescript-generator/versions-ts-generator.ts— added JSDoc to the generatedVersions,VersionsGTE, andVersionedtypes so IDE tooltips are populated in the generated output file.Original Prompt
Add user-facing documentation that explains how to configure and use multi-version API support: YAML config syntax, generated code layout, the
Versionedtype, route-handler authoring patterns, and REPL usage.Multi-version support introduces several new concepts that need clear documentation for users:
/<group>/<version>/...)types/<version>/..., sharedtypes/paths/...,types/versions.ts)VersionedtypeManual acceptance tests
docs/features/multiple-versions.mdexists and covers YAML config, URL layout, generated code layout,$.minVersion()handler example, and REPL usagedocs/usage.mdfeatures table contains a "Multiple versions" row linking to./features/multiple-versions.mddocs/reference.md"Multiple API versions" section documentsSpecConfig.version,Versioned<T,V>,Versions,VersionsGTE, andtypes/versions.tstypes/versions.tsfor a versioned group producesVersions,VersionsGTE, andVersionedtypes with JSDoc comments visible in IDE hover tooltipsversions-ts-generatortests passTasks
docs/features/multiple-versions.mdwith config syntax, URL/code layout, handler authoring, and REPL sections; TypeScript narrowing details placed at the bottomversionas required in the config field reference tabledocs/usage.mddocs/reference.mdVersions,VersionsGTE, andVersionedinversions-ts-generator.ts