idl_gen_json_schema Fix generation of arrays of enums (#6184)

* idl_gen_json_schema.cpp: Fixed generation of arrays of enums
#6175

* Fixed failing unit tests

* GenBaseType generate "integer".
Fixes #6066

* Ran tests/generate_code.

* Removed modern R"()" strings

* changed std::to_string to NumToString
This commit is contained in:
schoetbi
2020-10-16 19:43:09 +02:00
committed by GitHub
parent 0e1415b996
commit a402b3abae
3 changed files with 111 additions and 89 deletions

View File

@@ -9,7 +9,7 @@
"type" : "object",
"properties" : {
"a" : {
"type" : "array", "items" : { "type" : "number" },
"type" : "array", "items" : {"type" : "integer", "minimum" : -2147483648, "maximum" : 2147483647},
"minItems": 2,
"maxItems": 2
},
@@ -22,7 +22,7 @@
"maxItems": 2
},
"d" : {
"type" : "array", "items" : { "type" : "number" },
"type" : "array", "items" : {"type" : "integer", "minimum" : -9223372036854775808, "maximum" : 9223372036854775807},
"minItems": 2,
"maxItems": 2
}
@@ -36,23 +36,23 @@
"type" : "number"
},
"b" : {
"type" : "array", "items" : { "type" : "number" },
"type" : "array", "items" : {"type" : "integer", "minimum" : -2147483648, "maximum" : 2147483647},
"minItems": 15,
"maxItems": 15
},
"c" : {
"type" : "number"
"type" : "integer", "minimum" : -128, "maximum" : 127"
},
"d" : {
"type" : "array", "items" : { "$ref" : "#/definitions/MyGame_Example_NestedStruct" },
"$ref" : "#/definitions/MyGame_Example_NestedStruct",
"minItems": 2,
"maxItems": 2
},
"e" : {
"type" : "number"
"type" : "integer", "minimum" : -2147483648, "maximum" : 2147483647
},
"f" : {
"type" : "array", "items" : { "type" : "number" },
"type" : "array", "items" : {"type" : "integer", "minimum" : -9223372036854775808, "maximum" : 9223372036854775807},
"minItems": 2,
"maxItems": 2
}