ONDC-Official / ONDC-Protocol-Specs

Open Network for Digital Commerce (ONDC) Open API Specifications. ONDC is an ambitious initiative to democratize digital commerce by creating a decentralized network of buyer apps and seller apps through an interoperable protocol specification.
Other
138 stars 59 forks source link

Bug: Statutory fields as extended properties in Item Schema will lead to break in interoperability. #33

Open ravi-prakash-v opened 2 years ago

ravi-prakash-v commented 2 years ago

Currently the Item schema in the retail-hyperlocal.yaml file has extended properties that has been namespaced by the ./ondc- keyword, specifically, the statutory fields.

The namespaced extensions are to be used only as a last resort when the core specification has undergone thorough stress testing against various use cases and not as a convenience.

All these values are read-only and can be accommodated in the tags property of the Item schema. Below is the description of the Tags schema as per beckn protocol version 0.9.3

Tags:
      description: Describes a tag. This is a simple key-value store which is used to contain extended metadata

This schema allows networks to transmit read-only data along with transaction schema.

All the statutory fields that are in-fact merely for display purposes need to be moved into the Tags schema. As you can see from the definition above, the core specification doesn't impose a mandate on what goes into the Tags schema. It simply mentions that all extended "metadata" can go in there.

The ONDC network policy must contain a document called "Supported Tags" that contains the names of those keys and mandate the all BPPs transmit those keys with their corresponding values. Given that these are only for display purposes, it doesn't break interoperability even if we add new fields. The statutory fields are clearly for display purposed and play no role in creating an order and hence must be moved to Tags.

Below is my proposal.

  1. I propose we move the statutory fields in Item.tags.
  2. Publish a list of supported tags in a document and link them to the Tags schema definition using the externalDocs attribute in OpenAPI.
  3. All the keys in the Tags schema must be percent-encoded (a.k.a URI encoding) by the BPP before publishing and must also be decoded as such by the BAP while rendering

@BLR-0118

BLR-0118 commented 2 years ago

Will be fixed as discussed with Beckn protocol team. Changes will be done shortly.