Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.

Commit aeb41fa

Browse files
authored
Update ship receipt schema with new validation rules
1 parent 22000e6 commit aeb41fa

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

schemas/v1.0.0/commercial/ship/receipts/ship.receipt.schema.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
"result": {
1212
"type": "object",
1313
"additionalProperties": false,
14-
"required": ["shipment_id","order_id","status"],
14+
"required": ["shipment_id", "order_id", "status"],
1515
"properties": {
1616
"shipment_id": { "type": "string", "minLength": 1, "maxLength": 128 },
1717
"shipment_group_id": { "type": "string", "minLength": 1, "maxLength": 128 },
1818
"order_id": { "type": "string", "minLength": 1, "maxLength": 128 },
19-
"status": { "type": "string", "enum": ["label_created","in_transit","delivered","failed","returned"] },
19+
"status": { "type": "string", "enum": ["label_created", "in_transit", "delivered", "failed", "returned"] },
2020
"carrier": { "type": "string", "maxLength": 64 },
2121
"tracking_number": { "type": "string", "maxLength": 128, "pattern": "^[A-Z0-9][-A-Z0-9]{5,}$" },
2222
"tracking_url": { "type": "string", "format": "uri", "maxLength": 512 },
@@ -33,12 +33,12 @@
3333
},
3434
"required": ["result"],
3535
"allOf": [
36-
{ "if": { "properties": { "status": { "const": "success" } }, "required": ["status"] }, "then": { "required": ["result"] } },
37-
{ "if": { "properties": { "status": { "const": "error" } }, "required": ["status"] }, "then": { "required": ["error"], "properties": { "result": false } } },
38-
{
39-
"if": { "properties": { "result": { "properties": { "status": { "enum": ["label_created","in_transit","delivered"] } } } } },
40-
"then": { "properties": { "result": { "required": ["carrier","tracking_number"] } } }
41-
}
36+
{ "if": { "properties": { "status": { "const": "success" } }, "required": ["status"] },
37+
"then": { "properties": { "result": {} }, "required": ["result"] } },
38+
{ "if": { "properties": { "status": { "const": "error" } }, "required": ["status"] },
39+
"then": { "properties": { "error": {}, "result": false }, "required": ["error"] } },
40+
{ "if": { "properties": { "result": { "properties": { "status": { "enum": ["label_created", "in_transit", "delivered"] } } } } },
41+
"then": { "properties": { "result": { "properties": { "carrier": {}, "tracking_number": {} }, "required": ["carrier", "tracking_number"] } } } }
4242
]
4343
}
4444
]

0 commit comments

Comments
 (0)