JSON
JSON Schema Validator
التحقق من بيانات JSON مقابل JSON Schema (نمط draft-07) — مع المسار الدقيق وشرح لكل مخالفة.
JSON Schema describes the expected structure of a JSON document — which fields are required, what type they are, and what constraints apply to their values. This tool checks actual data against a schema and shows the exact path to every violation.
How to use it
- Paste a JSON Schema into one field and the data to validate into the other.
- The result lists each violation separately: the exact path to the problem field and a plain-language explanation of why it doesn't match the schema.
- Valid data is immediately flagged as fully compliant with the schema.
Common uses
- Checking a third-party API response against its documented schema before integrating with it.
- Debugging your own JSON Schema — figuring out why seemingly valid data gets rejected.
- Validating a configuration file against a schema before deploying.
Things to keep in mind
JSON Schema has several versions (draft-07, 2019-09, 2020-12) with small syntax differences — check which version your production validator actually expects.
required only checks that a field is present, not its value — an empty string or null still counts as "present" if the type allows it.
مقالة عن هذه الأداة: JSON Schema: كيف تصف وتتحقق من بنية JSON
الأسئلة الشائعة
ماذا يعني ظهور خطأ تحقق لمسار معيّن؟
يعني أن البيانات في ذلك المسار لا تحقق أحد قيود المخطط، مثل نوع خاطئ أو خاصية مطلوبة مفقودة أو عدم تطابق نمط أو قيمة خارج النطاق المسموح.
ما إصدار JSON Schema المدعوم؟
تدعم الأداة أسلوب draft-07، وهو من أكثر إصدارات JSON Schema استخدامًا وتغطي معظم الكلمات المفتاحية الشائعة مثل required وtype وpattern.
هل يُرسل المخطط أو البيانات إلى خادم للتحقق؟
لا، التحقق بأكمله يتم محليًا في المتصفح عبر JavaScript، دون رفع المخطط أو البيانات إلى أي مكان.
ماذا يفعل additionalProperties: false؟
افتراضيًا يمكن للكائن أن يحتوي أي حقول تتجاوز ما وُصف في properties. يمنع additionalProperties: false الحقول الزائدة — مفيد لاكتشاف خطأ إملائي في اسم مفتاح أو حقل تصحيح (debug) نُسي عن طريق الخطأ.
هل يمكن وصف حقل يقبل عدة أنواع؟
نعم، عبر مصفوفة في type، مثل "type": ["string", "null"] إذا كان الحقل يمكن أن يكون سلسلة أو null. للحالات الأكثر تعقيدًا تُستخدم الكلمات المفتاحية oneOf أو anyOf أو allOf.