JSON स्कीमा जनरेटर

उदाहरण JSON डेटा से JSON Schema जनरेट करें

JSON इनपुट
Paste example JSON or import a file to infer a starting schema.
जनरेट किया गया स्कीमा
Review the generated schema, then copy or download it for further refinement.
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "age": {
      "type": "integer"
    },
    "active": {
      "type": "boolean"
    },
    "website": {
      "type": "string",
      "format": "uri"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "address": {
      "type": "object",
      "properties": {
        "street": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "postalCode": {
          "type": "string"
        }
      },
      "required": [
        "street",
        "city",
        "postalCode"
      ]
    },
    "projects": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "year": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "name",
          "year"
        ]
      }
    },
    "lastSeen": {
      "type": "string",
      "format": "date-time"
    },
    "metadata": {
      "type": "null"
    }
  },
  "required": [
    "id",
    "name",
    "email",
    "age",
    "active",
    "website",
    "tags",
    "address",
    "projects",
    "lastSeen",
    "metadata"
  ]
}
विकल्प

JSON Schema क्या है?

JSON Schema, JSON डेटा की संरचना बताने का एक मानक है। इसकी मदद से आप फ़ील्ड के प्रकार, nested structure, required keys और validation के लिए उपयोगी constraints को मशीन-पठनीय रूप में व्यक्त कर सकते हैं।

यह generator क्या करता है

उदाहरण JSON पेस्ट करने पर यह टूल objects, arrays, numbers, booleans, null और सामान्य string formats के लिए शुरुआती schema तैयार करता है। परिणाम को कॉपी, डाउनलोड और आगे refine किया जा सकता है।

उदाहरण

उदाहरण के लिए, इस sample payload को देखें:

उदाहरण इनपुट

{
  "id": "bk-101",
  "title": "In-browser Tools",
  "price": 19.99,
  "tags": ["json", "schema"],
  "published": true
}

जेनरेट किया गया schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "title": { "type": "string" },
    "price": { "type": "number" },
    "tags": {
      "type": "array",
      "items": { "type": "string" }
    },
    "published": { "type": "boolean" }
  },
  "required": ["id", "title", "price", "tags", "published"]
}

सुझाव

  • जहाँ संभव हो representative sample data दें, खासकर arrays के अंदर, ताकि optional fields बेहतर पकड़े जाएँ।
  • अगर इनपुट केवल अधूरा उदाहरण है, तो “Infer required properties” बंद कर दें।
  • अगर आपको default रूप से अधिक strict schema चाहिए, तो “Allow additional properties” बंद करें।
  • email, URI, UUID और date-time पहचानने के लिए string format detection चालू रखें।