Skip to content

Fix/mobility-devkit: resolve validation errors across devkit and example payloads - #90

Open
riteshkparouha-cyber wants to merge 3 commits into
beckn:mainfrom
riteshkparouha-cyber:fix/mobility-devkit
Open

Fix/mobility-devkit: resolve validation errors across devkit and example payloads#90
riteshkparouha-cyber wants to merge 3 commits into
beckn:mainfrom
riteshkparouha-cyber:fix/mobility-devkit

Conversation

@riteshkparouha-cyber

Copy link
Copy Markdown
Contributor

Devkit & Infrastructure

  1. Network ID corrected — changed nfh.global/testnet-mobility →
    nfh.global/testnet in devkit config to resolve failed to lookup registry:
    context.network_id "nfh.global/testnet-mobility" is not in
    network_memberships of subscriber "bpp.example.com"
  2. context.try removed from sandbox payloads — stripped from all actions
    outside update and cancel in sandbox-payloads/; spec restricts try to the
    two-phase preview/commit pattern on those two actions only
  3. Sandbox BPP volume path updated — changed volume directory of
    sandbox-bpp to serve static payloads through nfh.global/testnet
  4. Catalog request examples removed — removed catalog-related request
    examples from docs/example_implementations/ride_hailing/; mobility discover
    is peer-to-peer so the catalog flow does not apply

Example JSON Fixes

All fixes are grounded in the Beckn Protocol Specification v2 — beckn.yaml.

  • error.details.cause type corrected across 172 files — Example payloads
    were using a plain string (e.g. "cause": "downstream timeout") as a
    placeholder for this field. The spec defines cause as a self-referencing
    Error object, enabling structured, typed error chains (e.g. wrapping a
    registry failure or provider error inside a parent error). A string value
    fails schema validation and loses that chain structure entirely.
  • context.try removed from 117 non-update/cancel payloads — The try flag
    enables a two-phase preview/commit pattern where the receiving NP computes
    revised terms without mutating state. The spec only defines this behaviour
    for /update and /cancel. Including try on actions like discover, init,
    confirm, etc. is meaningless per the spec and was carried over as
    copy-paste noise from update/cancel templates.
  • quantity added to commitments[].resources[] in 14 files — The spec marks
    quantity as a required field on every resource item inside a commitment
    (alongside id). It was missing from the generic lifecycle example files,
    causing schema validation to fail on those payloads. Added as {"value": 1,
    "unit": "unit"} to satisfy the constraint.
  • GeoJSONGeometry.bbox corrected across 18 files — The spec enforces
    minItems: 4 on bbox, representing a bounding box as [west, south, east,
    north] (southwest lon/lat + northeast lon/lat) per the GeoJSON standard.
    The placeholder value [0] was a single-element array that both violates the
    schema constraint and carries no geographic meaning.

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