diff --git a/DEPENDENCIES b/DEPENDENCIES index ff6faa61..160ff3bf 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -1,5 +1,5 @@ vendorpull https://github.com/sourcemeta/vendorpull 1dcbac42809cf87cb5b045106b863e17ad84ba02 -core https://github.com/sourcemeta/core 376f397db98e72be48d8401e2fbf2ee96f033966 +core https://github.com/sourcemeta/core 8c41142add7cfe32ddf787c13613732a5c62c493 jsonbinpack https://github.com/sourcemeta/jsonbinpack 0c2340990bf31c630155991a93306990d9d94fd4 blaze https://github.com/sourcemeta/blaze 93342104a85814bc0fd11792d305c4e83de259c0 hydra https://github.com/sourcemeta/hydra c86d2165a2f27f838837af1a5af24b1055a35317 diff --git a/vendor/core/src/core/jsonschema/format.cc b/vendor/core/src/core/jsonschema/format.cc index 266abead..1940c54e 100644 --- a/vendor/core/src/core/jsonschema/format.cc +++ b/vendor/core/src/core/jsonschema/format.cc @@ -140,7 +140,7 @@ auto format(JSON &schema, const SchemaWalker &walker, const SchemaResolver &resolver, std::string_view default_dialect) -> void { assert(is_schema(schema)); - std::vector objects_to_reorder; + std::vector subschemas; { SchemaFrame frame{SchemaFrame::Mode::Locations}; @@ -152,16 +152,15 @@ auto format(JSON &schema, const SchemaWalker &walker, continue; } - auto &subschema{get(schema, entry.second.pointer)}; - if (subschema.is_object()) { - objects_to_reorder.push_back(&subschema); - } + subschemas.push_back(to_pointer(entry.second.pointer)); } } - // Now apply the reordering after the frame is destroyed - for (auto *object : objects_to_reorder) { - object->reorder(keyword_compare); + for (const auto &pointer : subschemas) { + auto &subschema{get(schema, pointer)}; + if (subschema.is_object()) { + subschema.reorder(keyword_compare); + } } }