Skip to content

chore(deps): bump amf-client-js + api-model-generator for OAS 3.1/3.2 (TD-0333486) - #905

Draft
alexpmule wants to merge 1 commit into
masterfrom
spike/oas-3x-amf-bump
Draft

chore(deps): bump amf-client-js + api-model-generator for OAS 3.1/3.2 (TD-0333486)#905
alexpmule wants to merge 1 commit into
masterfrom
spike/oas-3x-amf-bump

Conversation

@alexpmule

Copy link
Copy Markdown
Contributor

What

Bump the two dependencies on the console's model-generation path so it runs on an AMF line that supports OAS 3.1 and 3.2:

  • amf-client-js ^5.4.4^5.11.7902
  • @api-components/api-model-generator ^0.2.14^0.3.1

Why

Enabling step for TD-0333486 (render OAS 3.1/3.2 in the console). The rendering work lands in follow-up PRs; this PR only moves the dependency floor so fixtures for the new constructs can be generated at all.

The generator was pinned to a nested amf-client-js@4.7.8 that predates OAS 3.1/3.2. Bumping amf-client-js alone is cosmetic — the fixture path (demo/model.jsapi-model-generator) kept resolving 4.7.8. Bumping the generator to 0.3.1 (which depends on amf-client-js@^5.10.2) is what actually dedupes the fixture path onto the 5.11.x line.

Verification

  • npm run build (rollup) succeeds with the bumped deps.
  • ✅ AMF 5.11.7902 parses OAS 3.1 and 3.2 specs (conforms: true).
  • ✅ Empirically confirmed the model shape the console will consume, from generated JSON-LD:
    • Webhooks attach as a apiContract#webhooks collection of EndPoint nodes — a sibling to apiContract#endpoint, same node type as REST endpoints (not a separate API type). A webhook's path is a name (newPet), not a served URL.
    • QUERY method modeled (method: QUERY).
    • SSE modeled (text/event-stream + itemSchema).

Follow-ups (not in this PR)

  1. api-model-generator needs code, not just a bump. Its getConfiguration switch stops at OAS 3.0 and throws Unknown API type: OAS 3.1/3.2, even though the underlying amf-client-js exposes OASConfiguration.OAS31()/OAS32(). Adding those cases is a separate change in that (ACM-owned) package.
  2. Console rendering. The nav collector reads only apiContract#endpoint, so the webhooks collection is silently dropped today. Rendering webhooks = read the collection + surface it (section vs. badge — product decision) + suppress try-it (gRPC precedent).

Notes

  • A residual amf-client-js@4.7.8 remains under @api-components/api-summary's own nested api-model-generator@0.2.14 (transitive devDep). It is not on the fixture/runtime path; left untouched to avoid forcing a transitive without vendor validation.
  • Pre-release caveat: 5.11.7902 is a snapshot/RC line (the stable latest is 5.10.2-10, no OAS 3.2). Consuming it pins a pre-release — acceptable for the spike/enabling step; revisit if a GA lands.

TD-0333486

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
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