包含 $schema 头——前置 draft-07 声明,让校验器知道 Schema 使用的方言。示例:"$schema": "http://json-schema.org/draft-07/schema#"
标记 required 键——把示例 JSON 中出现的每个键加入 required 列表。示例:"required": ["name", "price", "inStock"]
把小值集合并为 enum——当标量数组有 2–8 个不重复值时,其项类型收窄为枚举。示例:"tags": ["sale", "new", "sale"] → "tags": {"type": "array", "items": {"type": "string", "enum": ["sale", "new"]}}
检测常见字符串格式——识别 ISO 日期、日期时间、UUID、邮箱与 URL 并添加 format。示例:"createdAt": {"type": "string", "format": "date-time"}