From bfdda20f5b230c86f26bd49d74332f70ab7855b3 Mon Sep 17 00:00:00 2001 From: Volker Christian Date: Mon, 19 Jun 2023 16:47:34 +0200 Subject: [PATCH] Fix bug: attr.value() of an array attribute returns an iterator of basic_json objects not an iterator of std::string (#276) --- src/json-validator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/json-validator.cpp b/src/json-validator.cpp index 3c73d98..36df670 100644 --- a/src/json-validator.cpp +++ b/src/json-validator.cpp @@ -604,10 +604,12 @@ public: } break; case json::value_t::array: // "type": ["type1", "type2"] - for (auto &schema_type : attr.value()) + for (auto &array_value : attr.value()) { + auto schema_type = array_value.get(); for (auto &t : schema_types) if (t.first == schema_type) type_[static_cast(t.second)] = type_schema::make(sch, t.second, root, uris, known_keywords); + } break; default: