(schema, level = 0)
| 684 | } |
| 685 | |
| 686 | function generateMarkdownForArrayAndObjectDescription(schema, level = 0) { |
| 687 | let markdown = ((schema.description || schema.title) && (schema.minItems || schema.maxItems)) ? '<span class="descr-expand-toggle">➔</span>' : ''; |
| 688 | if (schema.title) { |
| 689 | if (schema.description) { |
| 690 | markdown = `${markdown} <b>${schema.title}:</b> ${schema.description}<br/>`; |
| 691 | } else { |
| 692 | markdown = `${markdown} ${schema.title}<br/>`; |
| 693 | } |
| 694 | } else if (schema.description) { |
| 695 | markdown = `${markdown} ${schema.description}<br/>`; |
| 696 | } |
| 697 | if (schema.minItems) { |
| 698 | markdown = `${markdown} <b>Min Items:</b> ${schema.minItems}`; |
| 699 | } |
| 700 | if (schema.maxItems) { |
| 701 | markdown = `${markdown} <b>Max Items:</b> ${schema.maxItems}`; |
| 702 | } |
| 703 | if (level > 0 && schema.items?.description) { |
| 704 | let itemsMarkdown = ''; |
| 705 | if (schema.items.minProperties) { |
| 706 | itemsMarkdown = `<b>Min Properties:</b> ${schema.items.minProperties}`; |
| 707 | } |
| 708 | if (schema.items.maxProperties) { |
| 709 | itemsMarkdown = `${itemsMarkdown} <b>Max Properties:</b> ${schema.items.maxProperties}`; |
| 710 | } |
| 711 | markdown = `${markdown} ⮕ ${itemsMarkdown} [ ${schema.items.description} ] `; |
| 712 | } |
| 713 | return markdown; |
| 714 | } |
| 715 | /** |
| 716 | * For changing OpenAPI-Schema to an Object Notation, |
| 717 | * This Object would further be an input to UI Components to generate an Object-Tree |
no outgoing calls
no test coverage detected
searching dependent graphs…