ऑर्डर JSON Schema
उन्नत JSON Schema
स्थिति enum, लाइन आइटम एरे और कुल ऑब्जेक्ट के साथ एक व्यापक ऑर्डर Schema। अपने प्रोजेक्ट या परीक्षणों के लिए एक वास्तविक उदाहरण।
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Order",
"type": "object",
"properties": {
"orderId": { "type": "string", "pattern": "^ORD-[0-9]{5}$" },
"status": {
"type": "string",
"enum": ["pending", "confirmed", "shipped", "delivered", "cancelled"]
},
"items": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"productId": { "type": "string" },
"quantity": { "type": "integer", "minimum": 1 },
"unitPrice": { "type": "number", "minimum": 0 }
},
"required": ["productId", "quantity", "unitPrice"]
}
},
"totals": {
"type": "object",
"properties": {
"subtotal": { "type": "number" },
"tax": { "type": "number" },
"shipping": { "type": "number" },
"grandTotal": { "type": "number" }
}
}
},
"required": ["orderId", "status", "items"]
} टूल में खोलें
संबंधित उपकरण
और उदाहरण
- schema
- order
- ecommerce