10x402 / guides / wrong-bag

The wrong-bag contradiction: when your Bazaar example and schema disagree

A Bazaar declaration has two halves that must agree: info, one worked example of the call, and schema, the JSON Schema that example validates against. There is a specific way they disagree that is worth its own name, because a census of the live catalog found it 276 times across 59 hosts.

The shape

From a live specimen found on x402#3104 (a route template of /api/:name/followers):

info.input.pathParams   = { "name": "BobbyThakkar" }   // the example: name in the PATH
info.input.queryParams  = {}

schema …properties.queryParams = { …, "required": ["name"] }  // the schema: name as a QUERY param
schema …properties.pathParams  = { "type": "object" }         // and nothing about the path

The example supplies name as a path parameter. The schema requires name as a query parameter. The two halves of one declaration disagree about which bag the parameter lives in.

Both consumers lose

And no buyer can probe their way out. On most hosts the 402 answers before parameter validation (the same census measured ~94% of hosts returning 404 for an impossible path, but a 402-gated-before-routing platform answers 402 to everything), so the declaration is the only contract available before payment — and this one contradicts itself. The finding is about the declaration, not the service: the route may well accept both spellings. Nobody can know without paying.

The fix is one move

Make the halves agree, in whichever direction is true: either the schema names the bag the worked example really uses, or the example moves the key into the bag the schema requires. Then re-settle one call so the corrected declaration is re-crawled — rows are written by settlement, per resource (the indexing guide covers that mechanic).

Check it in CI for two cents

The generic mismatch and the wrong-bag diagnosis are separate checks here, because their fix messages differ: V2_BAZAAR_INFO_VALIDATES tells you the pair disagrees; V2_BAZAAR_BAG_MISMATCH names both bags — "required in queryParams, supplied in pathParams" — which is the fix spelled out.

curl -sS -X POST https://10x402.com/lint/one \
  -H 'content-type: application/json' \
  -d '{"url": "https://your-endpoint.example.com/api/thing", "check": "V2_BAZAAR_BAG_MISMATCH"}'

$0.02 live, $0.01 against a pasted response — priced for a CI step that runs on every commit. The full 82-check report is POST /lint at $0.25.