Skip to content

fix(schema): update checkout_mandate pattern to support dSD-JWT chain (#599)#610

Open
Harman-2 wants to merge 3 commits into
Universal-Commerce-Protocol:mainfrom
Harman-2:fix/checkout-mandate-schema-pattern
Open

fix(schema): update checkout_mandate pattern to support dSD-JWT chain (#599)#610
Harman-2 wants to merge 3 commits into
Universal-Commerce-Protocol:mainfrom
Harman-2:fix/checkout-mandate-schema-pattern

Conversation

@Harman-2

Copy link
Copy Markdown

Description

Updates the regex validation pattern for the checkout_mandate property inside the ap2_mandate.json schema. The previous regex constraint strictly required characters immediately following a tilde (~), which caused schema validation to fail when encountering the trailing tilde of compact SD-JWT strings or multi-hop ~~ delegate-SD-JWT chains emitted by the reference implementation. Loosening the pattern group modifier from + to * allows both empty segments and trailing tildes while maintaining the required character set validation.

Category (Required)

  • Capability: New schemas (Discovery, Cart, etc.) or extensions. (Requires Maintainer approval)

Related Issues

Fixes #599

Checklist

  • I have followed the Contributing Guide (including Conventional Commits title requirements and ! for breaking changes).
  • I have updated the documentation (if applicable).
  • My changes pass all local linting and formatting checks.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • (For Core/Capability) I have included/updated the relevant JSON schemas.
  • I have regenerated Python Pydantic models by running generate_models.sh under python_sdk.

Screenshots / Logs (if applicable)

git

Verified regex behavior variation via python environment simulation:

# Before Fix Pattern Verification (Fails on dSD-JWT wire format strings)
Before fix match result: None

# After Fix Pattern Verification (Successfully parses trailing tildes and multi-hop '~~' chains)
After fix match result: <re.Match object; span=(0, 62), match='eyJhbGciOiJFUzI1NiJ9.payload.sig~~disclosure1~disclosure2~'>

@google-cla

google-cla Bot commented Jul 18, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Jul 18, 2026
@damaz91

damaz91 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Hello @Harman-2, can you please sign the CLA (https://cla.developers.google.com/ )? It is a required step to contribute to UCP? Thanks in advance!

@damaz91 damaz91 added bug Something isn't working status:stale Applied when PR is waiting for author response for 30 days schema PR changing the UCP schema status:blocked and removed status:needs-triage Signal that the PR is ready for human triage status:stale Applied when PR is waiting for author response for 30 days labels Jul 20, 2026
@Harman-2

Copy link
Copy Markdown
Author

@google-cla recheck

@Harman-2
Harman-2 force-pushed the fix/checkout-mandate-schema-pattern branch from 58e54eb to 0dd6194 Compare July 20, 2026 16:39
@Harman-2

Copy link
Copy Markdown
Author

@damaz91 Thanks for heads up! The CLA has been signed.

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

Labels

area:payments bug Something isn't working schema PR changing the UCP schema status:under-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ap2_mandate.json: checkout_mandate pattern rejects the serialization the AP2 reference SDK emits — which wire form is intended?

3 participants