Skip to content

Commit 066b2e7

Browse files
committed
fix: support schema 2019 && 2020 detection
1 parent 0337426 commit 066b2e7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/JSONSchema.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ func validator(for schema: [String: Any]) -> Validator {
6868
return Draft4Validator(schema: schema)
6969
}
7070

71+
if let id = DRAFT_2020_12_META_SCHEMA["$id"] as? String, schemaURI == id {
72+
return Draft202012Validator(schema: schema)
73+
}
74+
75+
if let id = DRAFT_2019_09_META_SCHEMA["$id"] as? String, schemaURI == id {
76+
return Draft201909Validator(schema: schema)
77+
}
78+
7179
if let id = DRAFT_07_META_SCHEMA["$id"] as? String, schemaURI == id {
7280
return Draft7Validator(schema: schema)
7381
}

0 commit comments

Comments
 (0)