Commit 2f3f2cfa authored by Boris Kocherov's avatar Boris Kocherov

take into account schema.const also limit schema selection

parent 47d96a14
......@@ -393,7 +393,9 @@
if (schema_arr.length === 1) {
if (schema_arr[0].schema === true ||
!(schema_arr[0].schema.hasOwnProperty('type') ||
schema_arr[0].schema.hasOwnProperty('enum'))) {
schema_arr[0].schema.hasOwnProperty('enum') ||
schema_arr[0].schema.hasOwnProperty('const')
)) {
return false;
}
if (schema_arr[0].schema.type instanceof Array) {
......@@ -522,7 +524,8 @@
description = schema_item.title;
if (schema_item.schema === true ||
!(schema_item.schema.hasOwnProperty('type') ||
schema_item.schema.hasOwnProperty('enum'))) {
schema_item.schema.hasOwnProperty('enum') ||
schema_item.schema.hasOwnProperty('const'))) {
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