{
"type": "object",
"$defs": {
"address": {
"type": "object",
"properties": {
"line1": { "type": "string", "minLength": 1, "maxLength": 120 },
"line2": { "type": "string", "maxLength": 120 },
"city": { "type": "string", "minLength": 1, "maxLength": 80 },
"postal_code": { "type": "string", "minLength": 3, "maxLength": 20 },
"country": { "type": "string", "pattern": "^[A-Z]{2}$" }
},
"required": ["line1", "city", "postal_code", "country"],
"additionalProperties": false
}
},
"properties": {
"order_id": { "type": "string", "pattern": "^ORD-[0-9]{4,10}$" },
"billing_address": { "$ref": "#/$defs/address" },
"shipping_address": { "$ref": "#/$defs/address" }
},
"required": ["order_id", "billing_address", "shipping_address"],
"additionalProperties": false
}