Skip to content

fix: misleading JSONPath example and inconsistent message.path descriptions#380

Open
sakinaroufid wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
sakinaroufid:fix-message-path-examples
Open

fix: misleading JSONPath example and inconsistent message.path descriptions#380
sakinaroufid wants to merge 1 commit intoUniversal-Commerce-Protocol:mainfrom
sakinaroufid:fix-message-path-examples

Conversation

@sakinaroufid
Copy link
Copy Markdown

@sakinaroufid sakinaroufid commented Apr 24, 2026

Summary

The path property on message_error, message_warning, and message_info is an optional RFC 9535 JSONPath pointer used to anchor a message to a specific component of the response payload. Its JSON Schema description is currently inconsistent across the three sibling schemas, and the example in message_error.json references a field that does not exist in the protocol.

Findings

  • message_info.json — description omits an example, giving schema consumers no pattern to follow.
  • message_warning.json — phrases the field as "JSONPath (RFC 9535) to related field", diverging from the sibling wording.
  • message_error.json — canonical phrasing, but the example points at $.items[1]. No top-level items collection is defined anywhere in checkout.json, cart.json, or order.json; the actual array is line_items (see also the JSONPath examples used in discount.json and message_warning.json). The example is therefore unresolvable against any valid response and is actively misleading.

Change

Unify the three description strings on a single canonical form — "RFC 9535 JSONPath to the component the message refers to (e.g., \$.line_items[0])." — matching the example pattern already used elsewhere in the schema set.

Test plan

  • JSON parses cleanly on all three files.
  • `cspell` pass on changed files (no new lexemes introduced).
  • `@biomejs/biome lint` pass.
  • Example JSONPath (`$.line_items[0]`) resolves against the `line_items` array declared in `checkout.json`, `cart.json`, and `order.json`.

Unify the `path` field description across `message_error.json`,
`message_warning.json`, and `message_info.json` so all three share the
same wording and example. Also fixes a stale example in
`message_error.json` that referenced `$.items[1]` — no `items` field
exists on checkout, cart, or order responses; the actual field is
`line_items`.
@sakinaroufid sakinaroufid requested review from a team as code owners April 24, 2026 17:35
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