|
3 | 3 | auto sourcemeta::core::schema_official_resolver(std::string_view identifier) |
4 | 4 | -> std::optional<sourcemeta::core::JSON> { |
5 | 5 | // JSON Schema 2020-12 |
6 | | - if (identifier == "https://json-schema.org/draft/2020-12/schema") { |
| 6 | + if (identifier == "https://json-schema.org/draft/2020-12/schema" || |
| 7 | + // Just for compatibility given that this is such a common issue |
| 8 | + identifier == "https://json-schema.org/draft/2020-12/schema#") { |
7 | 9 | return sourcemeta::core::parse_json( |
8 | 10 | R"EOF(@METASCHEMA_JSONSCHEMA_2020_12@)EOF"); |
9 | 11 | } else if (identifier == |
10 | | - "https://json-schema.org/draft/2020-12/hyper-schema") { |
| 12 | + "https://json-schema.org/draft/2020-12/hyper-schema" || |
| 13 | + identifier == |
| 14 | + "https://json-schema.org/draft/2020-12/hyper-schema#") { |
11 | 15 | return sourcemeta::core::parse_json( |
12 | 16 | R"EOF(@METASCHEMA_HYPERSCHEMA_2020_12@)EOF"); |
13 | 17 | } else if (identifier == |
@@ -52,21 +56,16 @@ auto sourcemeta::core::schema_official_resolver(std::string_view identifier) |
52 | 56 | return sourcemeta::core::parse_json( |
53 | 57 | R"EOF(@METASCHEMA_JSONSCHEMA_2020_12_OUTPUT@)EOF"); |
54 | 58 |
|
55 | | - // Just for compatibility given that this is such a common issue |
56 | | - } else if (identifier == "https://json-schema.org/draft/2020-12/schema#") { |
57 | | - return sourcemeta::core::parse_json( |
58 | | - R"EOF(@METASCHEMA_JSONSCHEMA_2020_12@)EOF"); |
59 | | - } else if (identifier == |
60 | | - "https://json-schema.org/draft/2020-12/hyper-schema#") { |
61 | | - return sourcemeta::core::parse_json( |
62 | | - R"EOF(@METASCHEMA_HYPERSCHEMA_2020_12@)EOF"); |
63 | | - |
64 | 59 | // JSON Schema 2019-09 |
65 | | - } else if (identifier == "https://json-schema.org/draft/2019-09/schema") { |
| 60 | + } else if (identifier == "https://json-schema.org/draft/2019-09/schema" || |
| 61 | + // Just for compatibility given that this is such a common issue |
| 62 | + identifier == "https://json-schema.org/draft/2019-09/schema#") { |
66 | 63 | return sourcemeta::core::parse_json( |
67 | 64 | R"EOF(@METASCHEMA_JSONSCHEMA_2019_09@)EOF"); |
68 | 65 | } else if (identifier == |
69 | | - "https://json-schema.org/draft/2019-09/hyper-schema") { |
| 66 | + "https://json-schema.org/draft/2019-09/hyper-schema" || |
| 67 | + identifier == |
| 68 | + "https://json-schema.org/draft/2019-09/hyper-schema#") { |
70 | 69 | return sourcemeta::core::parse_json( |
71 | 70 | R"EOF(@METASCHEMA_HYPERSCHEMA_2019_09@)EOF"); |
72 | 71 | } else if (identifier == |
@@ -106,16 +105,6 @@ auto sourcemeta::core::schema_official_resolver(std::string_view identifier) |
106 | 105 | "https://json-schema.org/draft/2019-09/output/hyper-schema") { |
107 | 106 | return sourcemeta::core::parse_json( |
108 | 107 | R"EOF(@METASCHEMA_HYPERSCHEMA_2019_09_OUTPUT@)EOF"); |
109 | | - |
110 | | - // Just for compatibility given that this is such a common issue |
111 | | - } else if (identifier == "https://json-schema.org/draft/2019-09/schema#") { |
112 | | - return sourcemeta::core::parse_json( |
113 | | - R"EOF(@METASCHEMA_JSONSCHEMA_2019_09@)EOF"); |
114 | | - } else if (identifier == |
115 | | - "https://json-schema.org/draft/2019-09/hyper-schema#") { |
116 | | - return sourcemeta::core::parse_json( |
117 | | - R"EOF(@METASCHEMA_HYPERSCHEMA_2019_09@)EOF"); |
118 | | - |
119 | 108 | // JSON Schema Draft7 |
120 | 109 | } else if (identifier == "http://json-schema.org/draft-07/schema#" || |
121 | 110 | identifier == "http://json-schema.org/draft-07/schema") { |
|
0 commit comments