Commit 016e9bfd authored by Boris Kocherov's avatar Boris Kocherov

for detect type use first value of array if can't detect type by document

parent 54e61d65
...@@ -724,7 +724,11 @@ ...@@ -724,7 +724,11 @@
if (getDocumentType(json_field.type) === "string") { if (getDocumentType(json_field.type) === "string") {
type = json_field.type; type = json_field.type;
} // else json_field.type is array so we use type } else if (type === undefined &&
default_value === undefined &&
getDocumentType(json_field.type) === "array") {
type = json_field.type[0];
}
if (["object", "array"].indexOf(type) >= 0 && if (["object", "array"].indexOf(type) >= 0 &&
default_value !== undefined && default_value !== undefined &&
getDocumentType(default_value) !== type) { getDocumentType(default_value) !== type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment