मुख्य सामग्री पर जाएं
CuteJSON
↑↓ नेविगेट करें Enter चुनें Esc बंद करें

उत्पाद JSON Schema

मध्यम JSON Schema

नेस्टेड मूल्य और एरे फ़ील्ड्स के साथ उत्पाद ऑब्जेक्ट्स को सत्यापित करने के लिए एक JSON Schema। कॉपी करने के लिए तैयार।

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Product",
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "name": { "type": "string", "minLength": 1 },
    "price": {
      "type": "object",
      "properties": {
        "amount": { "type": "number", "minimum": 0 },
        "currency": { "type": "string", "pattern": "^[A-Z]{3}$" }
      },
      "required": ["amount", "currency"]
    },
    "tags": {
      "type": "array",
      "items": { "type": "string" },
      "uniqueItems": true
    },
    "inStock": { "type": "boolean" }
  },
  "required": ["id", "name", "price"]
}
JSON उदाहरण