MCPcopy Index your code
hub / github.com/rapi-doc/RapiDoc / generateMarkdownForArrayAndObjectDescription

Function generateMarkdownForArrayAndObjectDescription

src/utils/schema-utils.js:686–714  ·  view source on GitHub ↗
(schema, level = 0)

Source from the content-addressed store, hash-verified

684}
685
686function 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

Callers 1

schemaInObjectNotationFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…