Skip to content

fix: validate Bazaar schema formats - #283

Open
epistemedeus wants to merge 1 commit into
coinbase:mainfrom
epistemedeus:fix/bazaar-schema-formats
Open

fix: validate Bazaar schema formats#283
epistemedeus wants to merge 1 commit into
coinbase:mainfrom
epistemedeus:fix/bazaar-schema-formats

Conversation

@epistemedeus

Copy link
Copy Markdown

Description

validateDiscoveryExtension() compiled Bazaar schemas without standard JSON
Schema format handlers. AJV therefore ignored declarations such as
format: "uri" and format: "date-time", accepted invalid values, and printed
warnings while validating otherwise machine-readable discovery data.

This patch registers ajv-formats on the existing AJV instance and adds invalid
and valid URI/date-time cases. It does not change the Bazaar schema shape or
payment behavior.

Most of this patch was generated with Codex. I reviewed the source and final
diff, reproduced the defect with the published package, removed unrelated
lockfile changes, and ran the checks below.

Tests

  • pnpm --filter @x402/core build
  • pnpm --filter @x402/extensions test (386 passed)
  • pnpm --filter @x402/extensions lint:check
  • pnpm --filter @x402/extensions format:check
  • pnpm --filter @x402/extensions build
  • frozen-lockfile install

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
  • My commit is signed
  • I added a changelog fragment for the user-facing fix

@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants