Skip to content

feat(demo): enable OAS 3.1/3.2 models + demo fixtures for API Console v6 (W-23748889) - #909

Open
alexpmule wants to merge 3 commits into
masterfrom
W-23748889/oas-31-32-fixtures
Open

feat(demo): enable OAS 3.1/3.2 models + demo fixtures for API Console v6 (W-23748889)#909
alexpmule wants to merge 3 commits into
masterfrom
W-23748889/oas-31-32-fixtures

Conversation

@alexpmule

Copy link
Copy Markdown
Contributor

What

Enables OAS 3.1 and 3.2 model generation in API Console v6 and adds two demo fixtures that exercise the modern-spec features, registered in the model manifest and the demo app picker.

Why

W-23748889 (parent W-23735927, TD-0333486). This WI is the foundation for the five rendering stories under the parent (oneOf/anyOf, if/then/else, QUERY, SSE, webhooks) — each needs real 3.1/3.2 fixtures to build and test against. The bump alone was not enough: the getConfiguration OAS31/OAS32 support lives in the external @api-components/api-model-generator package (published 0.3.1 threw Unknown API type: OAS 3.1), so this required a two-repo change.

Changes

  • deps: amf-client-js ^5.4.4^5.11.7902 (resolves to 5.11.12531, the AMF-team build that exposes OAS31/OAS32) and @api-components/api-model-generator ^0.2.14^0.4.0.
  • demo/models/oas31-webhooks/oas31-webhooks.yaml — OAS 3.1.0: top-level webhooks (POST newPet) + allOf / if-then-else / oneOf / anyOf schema composition.
  • demo/models/oas32-query-sse/oas32-query-sse.yaml — OAS 3.2.0: query: Path Item field (QUERY method) + /pets/events GET with text/event-stream + itemSchema (SSE).
  • demo/apis.json — manifest entries ("OAS 3.1" / "OAS 3.2").
  • demo/element/app.js — demo picker entries.

Generated models (demo/models/*.json) are gitignored build artifacts, regenerated by npm run generate-model.

Companion change (already merged + published)

Verification

  • @api-components/api-model-generator@0.4.0 installed; amf-client-js deduped to 5.11.12531 (single copy in the tree).
  • npm run generate-model → both specs generate: oas31-webhooks emits Webhook nodes; oas32-query-sse emits QUERY + event-stream. No regression on existing RAML/OAS 3.0/AsyncAPI fixtures.
  • Generator's own suite: 28/28 passing on Node 20 (incl. new OAS 3.1/3.2 tests).

🤖 Generated with Claude Code

Bump amf-client-js ^5.4.4 -> ^5.11.7902 and @api-components/api-model-generator
^0.2.14 -> ^0.3.1 so the console's model-generation path runs on an AMF line
that understands OAS 3.1 (webhooks, if/then/else) and OAS 3.2 (QUERY, SSE).

The generator was pinned to a nested amf-client-js 4.7.8 that predates OAS
3.1/3.2 support; without bumping it, generating 3.1/3.2 fixtures fails. This
is the enabling dependency step for TD-0333486 (rendering work lands
separately). Verified: rollup build succeeds; AMF 5.11.x parses 3.1/3.2 specs
and emits webhooks as a `webhooks` collection of EndPoint nodes (sibling to
`endpoint`), plus QUERY method and text/event-stream SSE.

TD-0333486
Adds two demo specs and registers them in the model manifest and demo
app picker so the console has real OAS 3.1/3.2 models to render against:

- oas31-webhooks.yaml: top-level webhooks + allOf/if-then-else/oneOf/anyOf
- oas32-query-sse.yaml: QUERY method + text/event-stream (SSE) via itemSchema

Both parse with conforms:true under AMF 5.11.x. Generated models are
build artifacts (demo/models/*.json, gitignored), produced by
generate-model once api-model-generator republishes with OAS 3.1/3.2
support (api-components/api-model-generator#20).

W-23748889 (parent W-23735927).
Bumps @api-components/api-model-generator ^0.3.1 -> ^0.4.0, which
exposes OAS31/OAS32 in getConfiguration and pulls amf-client-js
5.11.12531. Generates the OAS 3.1/3.2 demo models added in 68dde60.
@alexpmule
alexpmule requested a review from a team as a code owner August 14, 2026 14:53
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.

1 participant