add new schemas
This commit is contained in:
0
plugins/invalid_schemas/init.json
Normal file
0
plugins/invalid_schemas/init.json
Normal file
208
plugins/invalid_schemas/invalid_compile_schema/select.json
Normal file
208
plugins/invalid_schemas/invalid_compile_schema/select.json
Normal 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"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user