@@ -188,44 +188,6 @@ auto sourcemeta::core::reidentify(JSON &schema,
188188 assert (is_schema (schema));
189189 assert (schema.is_object ());
190190 schema.assign (id_keyword (base_dialect), JSON{new_identifier});
191-
192- if (schema.defines (" $ref" )) {
193- // Workaround top-level `$ref` with `allOf`
194- if (base_dialect == " http://json-schema.org/draft-07/schema#" ||
195- base_dialect == " http://json-schema.org/draft-07/hyper-schema#" ||
196- base_dialect == " http://json-schema.org/draft-06/schema#" ||
197- base_dialect == " http://json-schema.org/draft-06/hyper-schema#" ||
198- base_dialect == " http://json-schema.org/draft-04/schema#" ||
199- base_dialect == " http://json-schema.org/draft-04/hyper-schema#" ) {
200- // Note that if the schema already has an `allOf`, we can safely
201- // remove it, as it was by definition ignored by `$ref` already
202- if (schema.defines (" allOf" )) {
203- schema.erase (" allOf" );
204- }
205-
206- schema.assign (" allOf" , JSON::make_array ());
207- auto conjunction{JSON::make_object ()};
208- conjunction.assign (" $ref" , schema.at (" $ref" ));
209- schema.at (" allOf" ).push_back (std::move (conjunction));
210- schema.erase (" $ref" );
211- }
212-
213- // Workaround top-level `$ref` with `extends`
214- if (base_dialect == " http://json-schema.org/draft-03/schema#" ||
215- base_dialect == " http://json-schema.org/draft-03/hyper-schema#" ) {
216- // Note that if the schema already has an `extends`, we can safely
217- // remove it, as it was by definition ignored by `$ref` already
218- if (schema.defines (" extends" )) {
219- schema.erase (" extends" );
220- }
221-
222- schema.assign (" extends" , JSON::make_object ());
223- schema.at (" extends" ).assign (" $ref" , schema.at (" $ref" ));
224- schema.erase (" $ref" );
225- }
226- }
227-
228- assert (identify (schema, base_dialect).has_value ());
229191}
230192
231193auto sourcemeta::core::dialect (
0 commit comments