Moved test schemas to testData folder, removed schemas folder from plugin, and deleted schema_die path from config

This commit is contained in:
AshwiniK-protean
2025-03-05 15:54:44 +05:30
parent 02ebd9fd38
commit 19c8b35bdd
61 changed files with 139 additions and 7038 deletions

View File

@@ -0,0 +1,208 @@
{
"$id": "https://example.com/ondc/trv10/2.0.0",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"select": {
"$id": "select#",
"type": "object",
"properties": {
"context": {
"type": "object",
"properties": {
"location": {
"type": "value",
"properties": {
"city": {
"type": "value",
"properties": {
},
"required": ["code"]
},
"country": {
"type": "object",
"properties": {
},
"required": ["code"]
}
}
}
},
"required": [
"domain",
"location",
"action",
"bap_id",
"bap_uri",
"transaction_id",
"message_id",
"timestamp",
"ttl"
]
},
"message": {
"type": "object",
"properties": {
"intent": {
"type": "object",
"properties": {
"fulfillment": {
"type": "object",
"properties": {
"stops": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "object",
"properties": {
"gps": {
"type": "string"
}
},
"required": ["gps"]
},
"type": {
"type": "string",
"enum": ["START", "END"]
}
},
"required": ["location", "type"]
},
"minItems": 2,
"maxItems": 2
}
},
"required": ["stops"]
},
"payment": {
"type": "object",
"properties": {
"collected_by": {
"type": "string",
"enum": ["BPP", "BAP"]
},
"tags": {
"type": "array",
"minItems": 2,
"maxItems": 2,
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": ["SETTLEMENT_TERMS", "BUYER_FINDER_FEES"]
}
},
"required": ["code"]
}
},
"allOf": [
{
"if": {
"properties": {
"descriptor": {
"properties": {
"code": {
"const": "SETTLEMENT_TERMS"
}
},
"required": ["code"]
}
}
},
"then": {
"properties": {
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"SETTLEMENT_BASIS",
"SETTLEMENT_WINDOW",
"STATIC_TERMS",
"SETTLEMENT_TYPE",
"DELAY_INTEREST"
]
}
},
"required": ["code"]
},
"value": {
"type": "string"
}
},
"required": ["descriptor", "value"]
}
}
}
}
},
{
"if": {
"properties": {
"descriptor": {
"properties": {
"code": {
"const": "BUYER_FINDER_FEES"
}
},
"required": ["code"]
}
}
},
"then": {
"properties": {
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": {
"enum": ["BUYER_FINDER_FEES_PERCENTAGE"]
}
},
"required": ["code"]
},
"value": {
"type": "string",
"pattern": "^-?\\d+(\\.\\d+)?$"
}
},
"required": ["descriptor", "value"]
}
}
}
}
}
],
"required": ["descriptor"]
}
}
},
"required": ["collected_by", "tags"]
}
},
"required": ["fulfillment", "payment"]
}
},
"required": ["intent"]
}
}
}
}
}

View File

View File

@@ -0,0 +1,129 @@
{
"$id": "http://example.com/schema/searchSchema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"context": {
"type": "object",
"properties": {
"action": { "type": "string" },
"bap_id": { "type": "string" },
"bap_uri": { "type": "string", "format": "uri" },
"domain": { "type": "string" },
"location": {
"type": "object",
"properties": {
"city": {
"type": "object",
"properties": {
"code": { "type": "string" }
},
"required": ["code"]
},
"country": {
"type": "object",
"properties": {
"code": { "type": "string" }
},
"required": ["code"]
}
},
"required": ["city", "country"]
},
"message_id": { "type": "string", "format": "uuid" },
"timestamp": { "type": "string", "format": "date-time" },
"transaction_id": { "type": "string", "format": "uuid" },
"ttl": { "type": "string" },
"version": { "type": "string" }
},
"required": [
"action",
"bap_id",
"bap_uri",
"domain",
"location",
"message_id",
"timestamp",
"transaction_id",
"ttl",
"version"
]
},
"message": {
"type": "object",
"properties": {
"intent": {
"type": "object",
"properties": {
"fulfillment": {
"type": "object",
"properties": {
"stops": {
"type": "array",
"items": {
"type": "object",
"properties": {
"location": {
"type": "object",
"properties": {
"gps": { "type": "string", "pattern": "^\\d{1,3}\\.\\d+,\\s?\\d{1,3}\\.\\d+$" }
},
"required": ["gps"]
},
"type": { "type": "string", "enum": ["START", "END"] }
},
"required": ["location", "type"]
}
}
},
"required": ["stops"]
},
"payment": {
"type": "object",
"properties": {
"collected_by": { "type": "string", "enum": ["BPP", "BAP"] },
"tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "type": "string" }
},
"required": ["code"]
},
"display": { "type": "boolean" },
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"descriptor": {
"type": "object",
"properties": {
"code": { "type": "string" }
},
"required": ["code"]
},
"value": { "type": "string" }
},
"required": ["descriptor", "value"]
}
}
},
"required": ["descriptor", "display", "list"]
}
}
},
"required": ["collected_by", "tags"]
}
},
"required": ["fulfillment", "payment"]
}
}
}
},
"required": ["context", "message"]
}