Skip to content

test(mosaic): check fake FAPI responses against the OpenAPI spec - #10480

Draft
alexcarpenter wants to merge 4 commits into
mainfrom
carp/mosaic-fapi
Draft

alexcarpenter wants to merge 4 commits into
mainfrom
carp/mosaic-fapi

Conversation

@alexcarpenter

Copy link
Copy Markdown
Member

Description

Keeps the Mosaic fake FAPI in sync with the backend without touching FAPI.

  • Every mocked response is checked against the vendored FAPI OpenAPI spec (clerk/openapi-specs, fapi/2026-08-20.yml) in strict mode. A mismatch fails the test.
  • fapi-spec-gaps.ts lists where FAPI sends something the spec gets wrong, each citing the backend code that sends it. An entry fails once the spec catches up, so the list prunes itself.
  • allowSpecViolation lets a test send a deliberately broken response; it fails if the violation is never sent.
  • Builders and handlers fixed to match the spec (api key ids and 201 on create, SAML linking response, passkey verification, error long_message, and others).
  • Fixes the org members invite dialog not preselecting the only role when default_role is ''.
  • Manual sync: pnpm --filter @clerk/mosaic sync:fapi-spec, then test:feature. Documented in docs/testing.md.

Changeset is empty: the org profile is not exported yet.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other: test tooling

@vercel

vercel Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Oct 28, 2026 1:15pm UTC
swingset Ready Ready Preview Oct 28, 2026 1:15pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@changeset-bot

changeset-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4b3392a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@10480

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@10480

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@10480

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@10480

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10480

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10480

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10480

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@10480

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10480

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10480

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10480

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@10480

@clerk/express

npm i https://pkg.pr.new/@clerk/express@10480

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@10480

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10480

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@10480

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10480

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@10480

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@10480

@clerk/react

npm i https://pkg.pr.new/@clerk/react@10480

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@10480

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@10480

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@10480

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@10480

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@10480

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@10480

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@10480

commit: 4b3392a

Check the query and body clerk-js sends against the operation's
parameters and requestBody, reading form values as the declared types.
Record the request-side spec gaps the check found (tab_state on token
requests, status as a list on organization suggestions,
with_organization_account_linking on enterprise connections), give two
tests IDs in the format the api_keys subject pattern expects, and cap
local feature runs at two workers.

This branch was successfully deployed

2 active deployments
Preview – swingset — 4b3392a9 Deployed Oct 28, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 4b3392a9 Deployed Oct 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant