openapi-explorer 0.11.481 → 0.11.483
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -57,6 +57,8 @@ export default class SchemaTable extends LitElement {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
generateTree(data, dataType = 'object', key = '', description = '', schemaLevel = 0, indentLevel = 0) {
|
|
60
|
+
var _keyLabel;
|
|
61
|
+
|
|
60
62
|
const newSchemaLevel = data['::type'] && data['::type'].startsWith('xxx-of') ? schemaLevel : schemaLevel + 1;
|
|
61
63
|
const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' || key.startsWith('::OPTION') ? indentLevel : indentLevel + 1;
|
|
62
64
|
const leftPadding = tablePadding * newIndentLevel; // 2 space indentation at each level
|
|
@@ -141,7 +143,7 @@ export default class SchemaTable extends LitElement {
|
|
|
141
143
|
return undefined;
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
return html` <div class="tr primitive"> <div class="td key ${deprecated ? 'deprecated' : ''}" style="padding-left:${leftPadding}px"> ${keyLabel &&
|
|
146
|
+
return html` <div class="tr primitive"> <div class="td key ${deprecated ? 'deprecated' : ''}" style="padding-left:${leftPadding}px"> ${(_keyLabel = keyLabel) !== null && _keyLabel !== void 0 && _keyLabel.endsWith('*') ? html`<span class="key-label">${keyLabel.substring(0, keyLabel.length - 1)}</span><span style="color:var(--red)">*</span>` : key.startsWith('::OPTION') ? html`<span class="xxx-of-key">${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : html`${keyLabel ? html`<span class="key-label"> ${keyLabel}</span>` : html`<span class="xxx-of-descr">${schemaTitle}</span>`}`} </div> <div class="td key-type"> <div>${dataType === 'array' ? '[' : ''}<span class="${cssType}">${format || type}</span>${dataType === 'array' ? ']' : ''}</div> <div class="attributes ${cssType}" style="font-family:var(--font-mono)" title="${readOrWriteOnly === '🆁' && 'Read only attribute' || readOrWriteOnly === '🆆' && 'Write only attribute' || ''}">${readOrWriteOnly}</div> </div> <div class="td key-descr"> ${dataType === 'array' ? html`<span class="m-markdown-small">${unsafeHTML(marked(description))}</span>` : ''} <span class="m-markdown-small" style="font-family:var(--font-mono);vertical-align:middle"> ${unsafeHTML(marked(`${dataType === 'array' && description || `${schemaTitle ? `**${schemaTitle}:**` : ''} ${schemaDescription}` || ''}`))} </span> ${this.schemaDescriptionExpanded ? html` ${constraint ? html`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${constraint}</div><br>` : ''} ${defaultValue ? html`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Default: </span>${defaultValue}</div><br>` : ''} ${allowedValues ? html`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Allowed: </span>${allowedValues}</div><br>` : ''} ${pattern ? html`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Pattern: </span>${pattern}</div><br>` : ''} ${example ? html`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Example: </span>${example}</div><br>` : ''}` : ''} </div> </div> `;
|
|
145
147
|
}
|
|
146
148
|
/* eslint-enable indent */
|
|
147
149
|
|
|
@@ -527,7 +527,9 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
|
|
|
527
527
|
};
|
|
528
528
|
|
|
529
529
|
for (const key in schema.properties) {
|
|
530
|
-
|
|
530
|
+
var _schema$required;
|
|
531
|
+
|
|
532
|
+
if (!schema.deprecated && !schema.properties[key].deprecated && (_schema$required = schema.required) !== null && _schema$required !== void 0 && _schema$required.includes(key)) {
|
|
531
533
|
objTypeOption[`${key}*`] = schemaInObjectNotation(schema.properties[key], options, level + 1);
|
|
532
534
|
} else {
|
|
533
535
|
objTypeOption[key] = schemaInObjectNotation(schema.properties[key], options, level + 1);
|
|
@@ -570,7 +572,9 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
|
|
|
570
572
|
obj['::deprecated'] = schema.deprecated || false;
|
|
571
573
|
|
|
572
574
|
for (const key in schema.properties) {
|
|
573
|
-
|
|
575
|
+
var _schema$required2;
|
|
576
|
+
|
|
577
|
+
if (!schema.deprecated && !schema.properties[key].deprecated && (_schema$required2 = schema.required) !== null && _schema$required2 !== void 0 && _schema$required2.includes(key)) {
|
|
574
578
|
obj[`${key}*`] = schemaInObjectNotation(schema.properties[key], options, level + 1);
|
|
575
579
|
} else {
|
|
576
580
|
obj[key] = schemaInObjectNotation(schema.properties[key], options, level + 1);
|
|
@@ -70,6 +70,8 @@ class SchemaTable extends _lit.LitElement {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
generateTree(data, dataType = 'object', key = '', description = '', schemaLevel = 0, indentLevel = 0) {
|
|
73
|
+
var _keyLabel;
|
|
74
|
+
|
|
73
75
|
const newSchemaLevel = data['::type'] && data['::type'].startsWith('xxx-of') ? schemaLevel : schemaLevel + 1;
|
|
74
76
|
const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' || key.startsWith('::OPTION') ? indentLevel : indentLevel + 1;
|
|
75
77
|
const leftPadding = tablePadding * newIndentLevel; // 2 space indentation at each level
|
|
@@ -154,7 +156,7 @@ class SchemaTable extends _lit.LitElement {
|
|
|
154
156
|
return undefined;
|
|
155
157
|
}
|
|
156
158
|
|
|
157
|
-
return (0, _lit.html)` <div class="tr primitive"> <div class="td key ${deprecated ? 'deprecated' : ''}" style="padding-left:${leftPadding}px"> ${keyLabel &&
|
|
159
|
+
return (0, _lit.html)` <div class="tr primitive"> <div class="td key ${deprecated ? 'deprecated' : ''}" style="padding-left:${leftPadding}px"> ${(_keyLabel = keyLabel) !== null && _keyLabel !== void 0 && _keyLabel.endsWith('*') ? (0, _lit.html)`<span class="key-label">${keyLabel.substring(0, keyLabel.length - 1)}</span><span style="color:var(--red)">*</span>` : key.startsWith('::OPTION') ? (0, _lit.html)`<span class="xxx-of-key">${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : (0, _lit.html)`${keyLabel ? (0, _lit.html)`<span class="key-label"> ${keyLabel}</span>` : (0, _lit.html)`<span class="xxx-of-descr">${schemaTitle}</span>`}`} </div> <div class="td key-type"> <div>${dataType === 'array' ? '[' : ''}<span class="${cssType}">${format || type}</span>${dataType === 'array' ? ']' : ''}</div> <div class="attributes ${cssType}" style="font-family:var(--font-mono)" title="${readOrWriteOnly === '🆁' && 'Read only attribute' || readOrWriteOnly === '🆆' && 'Write only attribute' || ''}">${readOrWriteOnly}</div> </div> <div class="td key-descr"> ${dataType === 'array' ? (0, _lit.html)`<span class="m-markdown-small">${(0, _unsafeHtml.unsafeHTML)((0, _marked.marked)(description))}</span>` : ''} <span class="m-markdown-small" style="font-family:var(--font-mono);vertical-align:middle"> ${(0, _unsafeHtml.unsafeHTML)((0, _marked.marked)(`${dataType === 'array' && description || `${schemaTitle ? `**${schemaTitle}:**` : ''} ${schemaDescription}` || ''}`))} </span> ${this.schemaDescriptionExpanded ? (0, _lit.html)` ${constraint ? (0, _lit.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${constraint}</div><br>` : ''} ${defaultValue ? (0, _lit.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Default: </span>${defaultValue}</div><br>` : ''} ${allowedValues ? (0, _lit.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Allowed: </span>${allowedValues}</div><br>` : ''} ${pattern ? (0, _lit.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Pattern: </span>${pattern}</div><br>` : ''} ${example ? (0, _lit.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Example: </span>${example}</div><br>` : ''}` : ''} </div> </div> `;
|
|
158
160
|
}
|
|
159
161
|
/* eslint-enable indent */
|
|
160
162
|
|
|
@@ -544,7 +544,9 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
|
|
|
544
544
|
};
|
|
545
545
|
|
|
546
546
|
for (const key in schema.properties) {
|
|
547
|
-
|
|
547
|
+
var _schema$required;
|
|
548
|
+
|
|
549
|
+
if (!schema.deprecated && !schema.properties[key].deprecated && (_schema$required = schema.required) !== null && _schema$required !== void 0 && _schema$required.includes(key)) {
|
|
548
550
|
objTypeOption[`${key}*`] = schemaInObjectNotation(schema.properties[key], options, level + 1);
|
|
549
551
|
} else {
|
|
550
552
|
objTypeOption[key] = schemaInObjectNotation(schema.properties[key], options, level + 1);
|
|
@@ -587,7 +589,9 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
|
|
|
587
589
|
obj['::deprecated'] = schema.deprecated || false;
|
|
588
590
|
|
|
589
591
|
for (const key in schema.properties) {
|
|
590
|
-
|
|
592
|
+
var _schema$required2;
|
|
593
|
+
|
|
594
|
+
if (!schema.deprecated && !schema.properties[key].deprecated && (_schema$required2 = schema.required) !== null && _schema$required2 !== void 0 && _schema$required2.includes(key)) {
|
|
591
595
|
obj[`${key}*`] = schemaInObjectNotation(schema.properties[key], options, level + 1);
|
|
592
596
|
} else {
|
|
593
597
|
obj[key] = schemaInObjectNotation(schema.properties[key], options, level + 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-explorer",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.483",
|
|
4
4
|
"description": "OpenAPI Explorer - API viewer with dynamically generated components, documentation, and interaction console",
|
|
5
5
|
"author": "Rhosys Developers <developers@rhosys.ch>",
|
|
6
6
|
"type": "module",
|