Accept integer as a number in a list of types
This commit is contained in:
parent
a071c8bdc6
commit
64ca27518e
@ -133,9 +133,14 @@ void validate_type(const json &schema, const std::string &expected_type, const s
|
|||||||
|
|
||||||
// any of the types in this array
|
// any of the types in this array
|
||||||
if (type_instance.type() == json::value_t::array) {
|
if (type_instance.type() == json::value_t::array) {
|
||||||
if (std::find(type_instance.begin(),
|
if ((std::find(type_instance.begin(),
|
||||||
type_instance.end(),
|
type_instance.end(),
|
||||||
expected_type) != type_instance.end())
|
expected_type) != type_instance.end())
|
||||||
|
||
|
||||||
|
(expected_type == "integer" &&
|
||||||
|
std::find(type_instance.begin(),
|
||||||
|
type_instance.end(),
|
||||||
|
"number") != type_instance.end()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::ostringstream s;
|
std::ostringstream s;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user