DEVtoy
語言 · 繁體中文

JSON Schema 驗證器

使用 JSON Schema 驗證文件。檢視驗證錯誤,可選擇檢查格式。

使用方式

  1. 貼上輸入內容或載入下方範例。
  2. 調整選項後按「驗證 JSON」。
  3. 檢查結果後複製或下載。

無需上傳、無需帳號,處理完全於瀏覽器內完成。

輸入範例
{
  "id": "0192f4d2-6a2b-7c3d-8e4f-5a6b7c8d9e0f",
  "email": "ada@example",
  "age": 12,
  "roles": ["admin", "owner"],
  "nickname": "ada"
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["id", "email", "roles"],
  "properties": {
    "id": { "type": "string", "format": "uuid" },
    "email": { "type": "string", "format": "email" },
    "age": { "type": "integer", "minimum": 13 },
    "roles": { "type": "array", "items": { "enum": ["admin", "editor", "viewer"] }, "uniqueItems": true }
  },
  "additionalProperties": false
}

相關工具