feat: add service metadata on resource to all 3 SDKs#2200
Merged
CarsonRoscoe merged 9 commits intox402-foundation:mainfrom May 6, 2026
Merged
feat: add service metadata on resource to all 3 SDKs#2200CarsonRoscoe merged 9 commits intox402-foundation:mainfrom
CarsonRoscoe merged 9 commits intox402-foundation:mainfrom
Conversation
|
@aayushijain21 is attempting to deploy a commit to the Coinbase Team on Vercel. A member of the Team first needs to authorize it. |
CarsonRoscoe
reviewed
May 6, 2026
Contributor
CarsonRoscoe
left a comment
There was a problem hiding this comment.
Please update the x402-specification-v2.md file:
- The
**5.1 PaymentRequired Schema**section's json example to include these fields (lines 74-99) - The
ResourceInfotable (lines 125-133) to include these new fields as optional at the spec level
CarsonRoscoe
approved these changes
May 6, 2026
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds three optional service-metadata fields —
serviceName,tags,iconUrl— to the top-levelresourceobject on aPaymentRequiredresponse, and formalizes them in the bazaar extension spec. Facilitators use these to enrich Bazaar search results with a provider-published name, topical tags, and an icon, with no admin step.The CDP facilitator will parse these fields defensively from 402 responses. This PR formalizes the convention upstream so all three SDKs and the foundation spec agree on the shape and validation rules.
All changes are purely additive and backwards compatible:
?:,| None = None,omitempty); existing servers produce byte-identical 402 bodies.Tests
New tests in each SDK cover the helpers (boundaries at 32/33 chars, tag truncation,
data:/file:/javascript:/ftp:schemes, userinfo, IPv4 and IPv6 literals including[::1]and[2001:db8::1], mixed-caselocalhost, control characters\x00/\n/\x7f, relative paths) plus end-to-end extraction cases for the all-valid path and the all-invalid soft-drop path.Checklist