Commit 54e61d65 authored by Boris Kocherov's avatar Boris Kocherov

fix 0b2a8073 i am forget enum also limit type

parent 3246d9e0
......@@ -318,7 +318,9 @@
function checkSchemaArrOneChoise(schema_arr) {
if (schema_arr.length === 1) {
if (schema_arr[0].schema === true || !schema_arr[0].schema.hasOwnProperty('type')) {
if (schema_arr[0].schema === true ||
!(schema_arr[0].schema.hasOwnProperty('type') ||
schema_arr[0].schema.hasOwnProperty('enum'))) {
return false;
}
if (schema_arr[0].schema.type instanceof Array) {
......@@ -433,7 +435,9 @@
for (i = 0; i < schema_arr.length; i += 1) {
schema_item = schema_arr[i];
description = schema_item.title;
if (schema_item.schema === true || !schema_item.schema.hasOwnProperty('type')) {
if (schema_item.schema === true ||
!(schema_item.schema.hasOwnProperty('type') ||
schema_item.schema.hasOwnProperty('enum'))) {
generateItemsForAny(schema_item.property_name, schema_item.schema_path);
} else if (getDocumentType(schema_item.schema.type) === "array") {
description = description || schema_item.schema.description;
......
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