{
"type": "object",
"properties": {
"invoice_id": { "type": "string", "minLength": 1, "maxLength": 40 },
"vendor": { "type": "string", "minLength": 1, "maxLength": 120 },
"invoice_date": { "type": "string", "format": "date" },
"currency": { "type": "string", "pattern": "^[A-Z]{3}$" },
"total": { "type": "number", "minimum": 0 },
"line_items": {
"type": "array",
"minItems": 1,
"maxItems": 100,
"items": {
"type": "object",
"properties": {
"description": { "type": "string", "minLength": 1, "maxLength": 200 },
"quantity": { "type": "number", "minimum": 0 },
"unit_price": { "type": "number", "minimum": 0 },
"line_total": { "type": "number", "minimum": 0 }
},
"required": ["description", "quantity", "unit_price", "line_total"],
"additionalProperties": false
}
}
},
"required": ["invoice_id", "vendor", "invoice_date", "currency", "total", "line_items"],
"additionalProperties": false
}