Skip to content

@W-23748894 feat(webhooks): suppress Try-It per-operation for OAS 3.1/3.2 webhooks - #64

Merged
alexpmule merged 3 commits into
mainfrom
W-23748894-webhooks
Aug 21, 2026
Merged

@W-23748894 feat(webhooks): suppress Try-It per-operation for OAS 3.1/3.2 webhooks#64
alexpmule merged 3 commits into
mainfrom
W-23748894-webhooks

Conversation

@alexpmule

@alexpmule alexpmule commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@W-23748894

What

Renders OAS 3.1/3.2 top-level webhooks as first-class documentation.

Part of the webhooks feature for TD-0333486. Depends on @api-components/amf-helper-mixin >= 4.5.36 (PR W-23748894-webhooks on that repo), which resolves top-level apiContract#webhooks via an additive fallback.

Per-repo behavior:

  • api-navigation — dedicated "Webhooks" nav section.
  • api-method-documentation — shows the webhook event name instead of a URL.
  • api-documentation — suppresses the per-operation Try-It for webhooks (webhooks are event-driven; there is nothing to invoke).

Why

Webhooks are top-level in OAS 3.1/3.2 (not under paths). AC4: webhooks must render as their own first-class section with Try-It suppressed.

Dependency / publish gate

Ship the mixin (4.5.36) first, then raise the peer floor to ^4.5.36 here. Below 4.5.36 the resolver fallback does not exist and the feature silently no-ops with no error/log/metric.

Tests

Green in chromium + firefox. Inline AMF expanded-model fixtures.

Known QA notes (P2, non-blocking, tracked for the PR discussion)

  • AC-03 is proven in two halves (mixin suite proves resolution on 4.5.36 source; this suite proves suppression on the installed mixin) — no single end-to-end select→resolve→render→no-Try-It test, and no .action DOM-absence assertion.
  • No test consumes the real generated model; a future generator change to the apiContract#webhooks predicate would pass GREEN and break prod. A smoke test against a real compact model (at least in nav) is recommended.

Screenshots

Screenshot 2026-08-21 at 3 08 40 PM

@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Alex Perez <a***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request.

@alexpmule
alexpmule force-pushed the W-23748894-webhooks branch from fda02a3 to 3778a8b Compare August 18, 2026 22:18
effectiveNoTryIt now hides Try-It for a selected top-level webhook operation,
alongside the existing gRPC branch. Suppression is per-operation, not app-wide:
a webhook API may still expose invokable REST endpoints, which keep Try-It.

A webhook has no operation-level flag, so _isWebhookOperation resolves
membership from the model root via _computeWebhooks. The helper is guarded at
the package boundary (typeof this._computeWebhooks === 'function') because the
shared amf-helper-mixin is versioned independently, mirroring the gRPC fork's
optional-method guards in api-navigation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
alexpmule and others added 2 commits August 20, 2026 14:27
…nerator to 0.4.0

Bump @api-components/api-model-generator ^0.2.14 -> ^0.4.0 (amf-client-js 5.11
supports OAS 3.1/3.2) and the amf-helper-mixin peer floor ^4.5.1 -> ^4.5.38
(the _computeWebhooks resolver + apiContract.webhooks namespace key only exist
in 4.5.38+; below it the feature silently no-ops). Add a real OAS 3.1 webhooks
demo spec and register it so prepare generates its model. Make test/amf-loader.js
@graph-aware (amf-client-js 5.11 emits flattened @graph models) and rewrite the
webhooks test to load the generated model instead of hand-building AMF inline
and monkey-patching _computeWebhooks. Declare the webhooks members on the
element type definition.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…egistry

The lockfile had 22 `resolved` URLs pointing at the internal
nexus-proxy.repo.local.sfdc.net mirror, which the public GitHub Actions
runner cannot resolve — `npm install` failed with ENOTFOUND before any
test ran. Regenerated with an explicit --registry=https://registry.npmjs.org/
so every tarball resolves from the public registry. Versions are unchanged
(generator 0.4.0, amf-helper-mixin 4.5.38, amf-client-js 5.11.12531);
local suite: 155 passed, 0 failed.
@alexpmule
alexpmule marked this pull request as ready for review August 21, 2026 18:10
@alexpmule
alexpmule merged commit 38c8954 into main Aug 21, 2026
6 of 7 checks passed
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