diff --git a/src/config.cpp b/src/config.cpp index 1e07e7f9f..451fd5b64 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -33,8 +33,13 @@ struct ProviderOptionsObject_Element : JSON::Element { explicit ProviderOptionsObject_Element(std::vector& v) : v_{v} {} JSON::Element& OnObject(std::string_view name) override { - if (options_element_) - throw std::runtime_error("Each object in the provider_options array can only have one member (named value)"); + for (auto& v : v_) { + if (v.name == name) { + options_element_ = std::make_unique(v); + return *options_element_; + } + } + auto& options = v_.emplace_back(); options.name = name; options_element_ = std::make_unique(options);