মূল বিষয়বস্তুতে যান
CuteJSON
↑↓ নেভিগেট Enter নির্বাচন Esc বন্ধ

অর্ডার 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"]
}
JSON উদাহরণ