Fix bug: attr.value() of an array attribute returns an iterator of basic_json objects not an iterator of std::string (#276)

This commit is contained in:
Volker Christian 2023-06-19 16:47:34 +02:00 committed by GitHub
parent 1242ae1a4a
commit bfdda20f5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -604,10 +604,12 @@ public:
} break; } break;
case json::value_t::array: // "type": ["type1", "type2"] 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<std::string>();
for (auto &t : schema_types) for (auto &t : schema_types)
if (t.first == schema_type) if (t.first == schema_type)
type_[static_cast<uint8_t>(t.second)] = type_schema::make(sch, t.second, root, uris, known_keywords); type_[static_cast<uint8_t>(t.second)] = type_schema::make(sch, t.second, root, uris, known_keywords);
}
break; break;
default: default: