openapi-explorer 0.9.367 → 0.9.383
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.
- package/CHANGELOG.md +1 -0
- package/dist/browser/openapi-explorer.min.js +4 -4
- package/dist/browser/openapi-explorer.min.js.map +1 -1
- package/dist/es/components/api-request.js +3 -3
- package/dist/es/components/schema-table.js +5 -3
- package/dist/es/components/schema-tree.js +12 -12
- package/dist/es/styles/font-styles.js +1 -1
- package/dist/es/styles/schema-styles.js +1 -1
- package/dist/es/utils/schema-utils.js +29 -1
- package/dist/lib/components/api-request.js +3 -3
- package/dist/lib/components/schema-table.js +5 -3
- package/dist/lib/components/schema-tree.js +12 -12
- package/dist/lib/styles/font-styles.js +1 -1
- package/dist/lib/styles/schema-styles.js +1 -1
- package/dist/lib/utils/schema-utils.js +29 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit-element';
|
|
2
|
-
export default css`.hover-bg:hover{background:var(--bg3)}::selection{background:var(--selection-bg);color:var(--selection-fg)}.regular-font{font-family:var(--font-regular)}.mono-font{font-family:var(--font-mono)}.title{font-size:calc(var(--font-size-small) + 18px);font-weight:400}.sub-title{font-size:20px}.req-res-title{font-family:var(--font-regular);font-size:calc(var(--font-size-small) + 4px);font-weight:700}.tiny-title{font-size:calc(var(--font-size-small) + 1px);font-weight:700}.regular-font-size{font-size:var(--font-size-regular)}.small-font-size{font-size:var(--font-size-small)}.upper{text-transform:uppercase}.primary-text{color:var(--primary-color)}.bold-text{font-weight:700}.gray-text{color:var(--light-fg)}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.multiline{overflow:scroll;max-height:var(--resp-area-height,300px);color:var(--fg3)}.method-fg.put{color:var(--orange)}.method-fg.post{color:var(--green)}.method-fg.get,.method-fg.head{color:var(--blue)}.method-fg.delete{color:var(--red)}.method-fg.options{color:var(--purple)}.method-fg.patch{color:var(--yellow)}h1{font-family:var(--font-regular);font-size:28px;padding-top:10px;letter-spacing:normal;font-weight:400}h2{font-family:var(--font-regular);font-size:24px;padding-top:10px;letter-spacing:normal;font-weight:400}h3{font-family:var(--font-regular);font-size:18px;padding-top:10px;letter-spacing:normal;font-weight:400}h4{font-family:var(--font-regular);font-size:16px;padding-top:10px;letter-spacing:normal;font-weight:400}h5{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h6{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h1,h2,h3,h4,h5{margin-block-end:.2em}h3{margin-top:0}p{margin-block-start:.5em}a{color:var(--blue);cursor:pointer}a.inactive-link{color:var(--fg);text-decoration:none;cursor:text}code,pre{margin:0;font-family:var(--font-mono);font-size:calc(var(--font-size-mono) - 1px)}.m-markdown,.m-markdown-small{display:block}.m-markdown li,.m-markdown p,.m-markdown span{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 6px)}.m-markdown-small li,.m-markdown-small p,.m-markdown-small span{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 6px)}.m-markdown p:not(:first-child){margin-block-start:
|
|
2
|
+
export default css`.hover-bg:hover{background:var(--bg3)}::selection{background:var(--selection-bg);color:var(--selection-fg)}.regular-font{font-family:var(--font-regular)}.mono-font{font-family:var(--font-mono)}.title{font-size:calc(var(--font-size-small) + 18px);font-weight:400}.sub-title{font-size:20px}.req-res-title{font-family:var(--font-regular);font-size:calc(var(--font-size-small) + 4px);font-weight:700}.tiny-title{font-size:calc(var(--font-size-small) + 1px);font-weight:700}.regular-font-size{font-size:var(--font-size-regular)}.small-font-size{font-size:var(--font-size-small)}.upper{text-transform:uppercase}.primary-text{color:var(--primary-color)}.bold-text{font-weight:700}.gray-text{color:var(--light-fg)}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.multiline{overflow:scroll;max-height:var(--resp-area-height,300px);color:var(--fg3)}.method-fg.put{color:var(--orange)}.method-fg.post{color:var(--green)}.method-fg.get,.method-fg.head{color:var(--blue)}.method-fg.delete{color:var(--red)}.method-fg.options{color:var(--purple)}.method-fg.patch{color:var(--yellow)}h1{font-family:var(--font-regular);font-size:28px;padding-top:10px;letter-spacing:normal;font-weight:400}h2{font-family:var(--font-regular);font-size:24px;padding-top:10px;letter-spacing:normal;font-weight:400}h3{font-family:var(--font-regular);font-size:18px;padding-top:10px;letter-spacing:normal;font-weight:400}h4{font-family:var(--font-regular);font-size:16px;padding-top:10px;letter-spacing:normal;font-weight:400}h5{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h6{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h1,h2,h3,h4,h5{margin-block-end:.2em}h3{margin-top:0}p{margin-block-start:.5em}a{color:var(--blue);cursor:pointer}a.inactive-link{color:var(--fg);text-decoration:none;cursor:text}code,pre{margin:0;font-family:var(--font-mono);font-size:calc(var(--font-size-mono) - 1px)}.m-markdown,.m-markdown-small{display:block}.m-markdown li,.m-markdown p,.m-markdown span{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 6px)}.m-markdown-small li,.m-markdown-small p,.m-markdown-small span{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 6px)}.m-markdown p:not(:first-child){margin-block-start:12px}.m-markdown-small p:not(:first-child){margin-block-start:12px}.m-markdown :first-child,.m-markdown-small :first-child{margin-block-start:0}.m-markdown p,.m-markdown-small p{margin-block-end:0}.toolbar .m-markdown p,.toolbar .m-markdown-small p{margin-block-start:0}.m-markdown code span{font-size:var(--font-size-mono)}.m-markdown code,.m-markdown-small code{padding:1px 6px;border-radius:2px;color:var(--inline-code-fg);background-color:var(--bg3);font-size:calc(var(--font-size-mono));line-height:1.2}.m-markdown-small code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown pre,.m-markdown-small pre{white-space:pre-wrap;overflow-x:auto;line-height:normal;border-radius:2px;border:1px solid var(--code-border-color)}.m-markdown pre{padding:8px;background-color:var(--code-bg);color:var(--code-fg)}.m-markdown-small pre{margin-top:4px;padding:2px 4px;background-color:var(--bg3);color:var(--fg2)}.m-markdown pre code,.m-markdown-small pre code{border:none;padding:0}.m-markdown pre code{color:var(--code-fg);background-color:var(--code-bg);background-color:transparent}.m-markdown-small pre code{color:var(--fg2);background-color:var(--bg3)}.m-markdown ol,.m-markdown ul{padding-inline-start:30px}.m-markdown-small ol,.m-markdown-small ul{padding-inline-start:20px}.m-markdown a,.m-markdown-small a{color:var(--blue)}.m-markdown img,.m-markdown-small img{max-width:100%}.m-markdown table,.m-markdown-small table{border-spacing:0;margin:10px 0;border-collapse:separate;border:1px solid var(--border-color);border-radius:var(--border-radius);font-size:calc(var(--font-size-small) + 1px);line-height:calc(var(--font-size-small) + 4px);max-width:100%}.m-markdown-small table{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 2px);margin:8px 0}.m-markdown td,.m-markdown th,.m-markdown-small td,.m-markdown-small th{vertical-align:top;border-top:1px solid var(--border-color);line-height:calc(var(--font-size-small) + 4px)}.m-markdown tr:first-child th,.m-markdown-small tr:first-child th{border-top:0 none}.m-markdown td,.m-markdown th{padding:10px 12px}.m-markdown-small td,.m-markdown-small th{padding:8px 8px}.m-markdown th,.m-markdown-small th{font-weight:600;background-color:var(--bg2);vertical-align:middle}.m-markdown-small table code{font-size:calc(var(--font-size-mono) - 2px)}.m-markdown table code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown blockquote,.m-markdown-small blockquote{margin-inline-start:0;margin-inline-end:0;border-left:3px solid var(--border-color);padding:6px 0 6px 6px}`;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { css } from 'lit-element';
|
|
2
|
-
export default css`*,:after,:before{box-sizing:border-box}.tr{display:flex;flex:none;width:100%;box-sizing:content-box;border-bottom:1px dotted transparent}.td{display:block;flex:0 0 auto}.key{font-family:var(--font-mono);white-space:normal;word-break:break-all}.key-descr{font-family:var(--font-regular);flex-shrink:1;text-overflow:ellipsis;overflow:hidden;display:none;max-height:auto}.toolbar{display:none}.tr.xxx-of{border-top:1px dotted var(--primary-color)}.xxx-of-key{font-size:calc(var(--font-size-small) - 2px);font-weight:700;background-color:var(--primary-color);color:var(--primary-btn-text-color);border-radius:2px;line-height:calc(var(--font-size-small) + 6px);padding:0 5px;margin-bottom:1px;display:inline-block}.xxx-of-descr{font-family:var(--font-regular);
|
|
2
|
+
export default css`*,:after,:before{box-sizing:border-box}.tr{display:flex;flex:none;width:100%;box-sizing:content-box;border-bottom:1px dotted transparent}.td{display:block;flex:0 0 auto}.key{font-family:var(--font-mono);white-space:normal;word-break:break-all}.key-descr{font-family:var(--font-regular);flex-shrink:1;text-overflow:ellipsis;overflow:hidden;display:none;max-height:auto}.toolbar{display:none}.tr.xxx-of{border-top:1px dotted var(--primary-color)}.xxx-of-key{font-size:calc(var(--font-size-small) - 2px);font-weight:700;background-color:var(--primary-color);color:var(--primary-btn-text-color);border-radius:2px;line-height:calc(var(--font-size-small) + 6px);padding:0 5px;margin-bottom:1px;display:inline-block}.xxx-of-descr{font-family:var(--font-regular);font-size:calc(var(--font-size-small) - 1px);margin-left:2px}.bina,.byte,.date,.emai,.host,.ipv4,.pass,.stri,.string,.uri,.url,.uuid{color:var(--green)}.deci .blue,.doub,.floa,.int3,.int6,.inte,.numb,.number{color:var(--blue)}.null{color:var(--red)}.bool,.boolean{color:var(--orange)}.enum{color:var(--yellow)}.tree .toolbar{display:flex;justify-content:space-between}.toolbar{width:100%}.toolbar-item{cursor:pointer;padding:5px 0 5px 1rem;margin:0 1rem!important;color:#38b3f9;flex-shrink:0}.tree .toolbar .toolbar-item{display:none}.schema-root-type{cursor:auto;color:var(--fg2);font-weight:700;text-transform:uppercase}.schema-root-type.xxx-of{display:none}.toolbar-item:first-of-type{margin:0 2px 0 0}@media only screen and (min-width:576px){.key-descr{display:block}.tree .toolbar .toolbar-item{display:block}.toolbar{display:flex}}`;
|
|
@@ -6,6 +6,8 @@ const IS_MISSING_TYPE_INFO_TYPE = '';
|
|
|
6
6
|
/* Generates an schema object containing type and constraint info */
|
|
7
7
|
|
|
8
8
|
export function getTypeInfo(schema) {
|
|
9
|
+
var _schema$items;
|
|
10
|
+
|
|
9
11
|
if (!schema) {
|
|
10
12
|
return undefined;
|
|
11
13
|
}
|
|
@@ -28,7 +30,7 @@ export function getTypeInfo(schema) {
|
|
|
28
30
|
|
|
29
31
|
const info = {
|
|
30
32
|
type: dataType,
|
|
31
|
-
format: schema.format || '',
|
|
33
|
+
format: schema.format || ((_schema$items = schema.items) === null || _schema$items === void 0 ? void 0 : _schema$items.format) || '',
|
|
32
34
|
pattern: schema.pattern && !schema.enum ? schema.pattern : '',
|
|
33
35
|
readOrWriteOnly: schema.readOnly && '🆁' || schema.writeOnly && '🆆' || '',
|
|
34
36
|
deprecated: !!schema.deprecated,
|
|
@@ -84,6 +86,7 @@ export function getTypeInfo(schema) {
|
|
|
84
86
|
info.constraint = constraint;
|
|
85
87
|
info.html = JSON.stringify({
|
|
86
88
|
type: info.type,
|
|
89
|
+
format: info.format,
|
|
87
90
|
readOrWriteOnly: info.readOrWriteOnly,
|
|
88
91
|
constraint: info.constraint,
|
|
89
92
|
defaultValue: info.default,
|
|
@@ -392,26 +395,44 @@ export function schemaInObjectNotation(rawSchema, _, level = 0, suffix = '') {
|
|
|
392
395
|
return Object.assign({}, objWithAllProps, typeof obj === 'object' && !Array.isArray(obj) ? obj : {});
|
|
393
396
|
} else if (anyOf || oneOf) {
|
|
394
397
|
const objWithAnyOfProps = {};
|
|
398
|
+
let writeOnly = true;
|
|
399
|
+
let readOnly = true;
|
|
395
400
|
(anyOf || oneOf || []).forEach((v, index) => {
|
|
396
401
|
if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {
|
|
402
|
+
var _partialObj$Flags, _partialObj$Flags2;
|
|
403
|
+
|
|
397
404
|
const partialObj = schemaInObjectNotation(v, {});
|
|
398
405
|
objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`] = partialObj;
|
|
399
406
|
objWithAnyOfProps['::type'] = 'xxx-of-option';
|
|
407
|
+
readOnly && (readOnly = (_partialObj$Flags = partialObj['::flags']) === null || _partialObj$Flags === void 0 ? void 0 : _partialObj$Flags['🆁']);
|
|
408
|
+
writeOnly && (writeOnly = (_partialObj$Flags2 = partialObj['::flags']) === null || _partialObj$Flags2 === void 0 ? void 0 : _partialObj$Flags2['🆆']);
|
|
400
409
|
} else if (v.type === 'array' || v.items) {
|
|
410
|
+
var _partialObj$Flags3, _partialObj$Flags4;
|
|
411
|
+
|
|
401
412
|
// This else-if block never seems to get executed
|
|
402
413
|
const partialObj = schemaInObjectNotation(v, {});
|
|
403
414
|
objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`] = partialObj;
|
|
404
415
|
objWithAnyOfProps['::type'] = 'xxx-of-array';
|
|
416
|
+
readOnly && (readOnly = (_partialObj$Flags3 = partialObj['::flags']) === null || _partialObj$Flags3 === void 0 ? void 0 : _partialObj$Flags3['🆁']);
|
|
417
|
+
writeOnly && (writeOnly = (_partialObj$Flags4 = partialObj['::flags']) === null || _partialObj$Flags4 === void 0 ? void 0 : _partialObj$Flags4['🆆']);
|
|
405
418
|
} else {
|
|
419
|
+
var _objWithAnyOfProps$, _objWithAnyOfProps$2;
|
|
420
|
+
|
|
406
421
|
const prop = `::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`;
|
|
407
422
|
objWithAnyOfProps[prop] = `${getTypeInfo(v).html}`;
|
|
408
423
|
objWithAnyOfProps['::type'] = 'xxx-of-option';
|
|
424
|
+
readOnly && (readOnly = (_objWithAnyOfProps$ = objWithAnyOfProps['::flags']) === null || _objWithAnyOfProps$ === void 0 ? void 0 : _objWithAnyOfProps$['🆁']);
|
|
425
|
+
writeOnly && (writeOnly = (_objWithAnyOfProps$2 = objWithAnyOfProps['::flags']) === null || _objWithAnyOfProps$2 === void 0 ? void 0 : _objWithAnyOfProps$2['🆆']);
|
|
409
426
|
}
|
|
410
427
|
});
|
|
411
428
|
const obj = schemaInObjectNotation(schema, {}, 0);
|
|
412
429
|
const resultObj = typeof obj === 'object' && !Array.isArray(obj) ? obj : {};
|
|
413
430
|
resultObj[anyOf ? `::ANY~OF ${suffix}` : `::ONE~OF ${suffix}`] = objWithAnyOfProps;
|
|
414
431
|
resultObj['::type'] = 'xxx-of';
|
|
432
|
+
resultObj['::flags'] = {
|
|
433
|
+
'🆁': readOnly && '🆁',
|
|
434
|
+
'🆆': writeOnly && '🆆'
|
|
435
|
+
};
|
|
415
436
|
return resultObj;
|
|
416
437
|
} else if (Array.isArray(schema.type)) {
|
|
417
438
|
const obj = {}; // When a property has multiple types, then check further if any of the types are array or object, if yes then modify the schema using one-of
|
|
@@ -526,6 +547,8 @@ export function schemaInObjectNotation(rawSchema, _, level = 0, suffix = '') {
|
|
|
526
547
|
|
|
527
548
|
return obj;
|
|
528
549
|
} else if (schema.type === 'array' || schema.items) {
|
|
550
|
+
var _schema$items2;
|
|
551
|
+
|
|
529
552
|
// If Array
|
|
530
553
|
const obj = {};
|
|
531
554
|
obj['::title'] = schema.title || '';
|
|
@@ -541,6 +564,11 @@ export function schemaInObjectNotation(rawSchema, _, level = 0, suffix = '') {
|
|
|
541
564
|
readOnly: schema.readOnly,
|
|
542
565
|
writeOnly: schema.writeOnly
|
|
543
566
|
}, schema.items), {}, level + 1);
|
|
567
|
+
|
|
568
|
+
if ((_schema$items2 = schema.items) !== null && _schema$items2 !== void 0 && _schema$items2.items) {
|
|
569
|
+
obj['::array-type'] = schema.items.items.type;
|
|
570
|
+
}
|
|
571
|
+
|
|
544
572
|
return obj;
|
|
545
573
|
}
|
|
546
574
|
|
|
@@ -233,7 +233,7 @@ class ApiRequest extends _litElement.LitElement {
|
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
tableRows.push((0, _litElement.html)` <tr> <td style="width:160px;min-width:50px"> <div class="param-name ${paramSchema.deprecated ? 'deprecated' : ''}"> ${param.name}${!paramSchema.deprecated && param.required ? (0, _litElement.html)`<span style="color:var(--red)">*</span>` : ''} </div> <div class="param-type"> ${paramSchema.type === 'array' ? `${paramSchema.arrayType}` : `${paramSchema.format ? paramSchema.format : paramSchema.type}`}${!paramSchema.deprecated && param.required ? (0, _litElement.html)`<span style="opacity:0">*</span>` : ''} </div> </td> ${this.allowTry === 'true' ? (0, _litElement.html)` <td style="min-width:160px"> ${paramSchema.type === 'array' ? (0, _litElement.html)` <tag-input class="request-param" style="width:100%" data-ptype="${paramType}" data-pname="${param.name}" data-default="${Array.isArray(defaultVal) ? defaultVal.join('~|~') : defaultVal}" data-param-serialize-style="${paramStyle}" data-param-serialize-explode="${paramExplode}" data-array="true" placeholder="${paramSchema.example || (Array.isArray(defaultVal) ? defaultVal[0] : defaultVal) || 'add-multiple
|
|
236
|
+
tableRows.push((0, _litElement.html)` <tr> <td style="width:160px;min-width:50px"> <div class="param-name ${paramSchema.deprecated ? 'deprecated' : ''}"> ${param.name}${!paramSchema.deprecated && param.required ? (0, _litElement.html)`<span style="color:var(--red)">*</span>` : ''} </div> <div class="param-type"> ${paramSchema.type === 'array' ? `${paramSchema.arrayType}` : `${paramSchema.format ? paramSchema.format : paramSchema.type}`}${!paramSchema.deprecated && param.required ? (0, _litElement.html)`<span style="opacity:0">*</span>` : ''} </div> </td> ${this.allowTry === 'true' ? (0, _litElement.html)` <td style="min-width:160px"> ${paramSchema.type === 'array' ? (0, _litElement.html)` <tag-input class="request-param" style="width:100%" data-ptype="${paramType}" data-pname="${param.name}" data-default="${Array.isArray(defaultVal) ? defaultVal.join('~|~') : defaultVal}" data-param-serialize-style="${paramStyle}" data-param-serialize-explode="${paramExplode}" data-array="true" placeholder="${paramSchema.example || (Array.isArray(defaultVal) ? defaultVal[0] : defaultVal) || 'add-multiple ↩'}" .value="${Array.isArray(defaultVal) ? defaultVal : defaultVal.split(',')}"> </tag-input>` : paramSchema.type === 'object' ? (0, _litElement.html)` <textarea class="textarea request-param" part="textarea textarea-param" data-ptype="${paramType}-object" data-pname="${param.name}" data-default="${defaultVal}" data-param-serialize-style="${paramStyle}" data-param-serialize-explode="${paramExplode}" spellcheck="false" placeholder="${paramSchema.example || defaultVal || ''}" style="resize:vertical;width:100%;height:${'read focused'.includes(this.renderStyle) ? '180px' : '120px'}">${this.fillRequestWithDefault === 'true' ? defaultVal : ''}</textarea>` : (0, _litElement.html)` <input type="${paramSchema.format === 'password' ? 'password' : 'text'}" spellcheck="false" style="width:100%" placeholder="${paramSchema.example || defaultVal || ''}" class="request-param" part="textbox textbox-param" data-ptype="${paramType}" data-pname="${param.name}" data-default="${Array.isArray(defaultVal) ? defaultVal.join('~|~') : defaultVal}" data-array="false" @keyup="${this.requestParamFunction}" .value="${this.fillRequestWithDefault === 'true' ? defaultVal : ''}">`} </td>` : ''} ${this.renderStyle === 'focused' ? (0, _litElement.html)` <td> ${paramSchema.default || paramSchema.constraint || paramSchema.allowedValues || paramSchema.pattern ? (0, _litElement.html)` <div class="param-constraint"> ${paramSchema.constraint ? (0, _litElement.html)`<span style="font-weight:700">Constraints: </span>${paramSchema.constraint}<br>` : ''} ${paramSchema.pattern ? (0, _litElement.html)`<span style="font-weight:700">Pattern: </span>${truncateString(paramSchema.pattern, 60)}<br>` : ''} ${paramSchema.allowedValues && paramSchema.allowedValues.split('┃').map((v, i) => (0, _litElement.html)` ${i > 0 ? '|' : (0, _litElement.html)`<span style="font-weight:700">Allowed: </span>`} ${(0, _litElement.html)` <a part="anchor anchor-param-constraint" class="${this.allowTry === 'true' ? '' : 'inactive-link'}" data-type="${paramSchema.type === 'array' ? paramSchema.type : 'string'}" data-enum="${v.trim()}" @click="${e => {
|
|
237
237
|
const inputEl = e.target.closest('table').querySelector(`[data-pname="${param.name}"]`);
|
|
238
238
|
|
|
239
239
|
if (inputEl) {
|
|
@@ -375,7 +375,7 @@ class ApiRequest extends _litElement.LitElement {
|
|
|
375
375
|
const formdataPartSchema = (0, _schemaUtils.schemaInObjectNotation)(fieldSchema, {});
|
|
376
376
|
const paramSchema = (0, _schemaUtils.getTypeInfo)(fieldSchema);
|
|
377
377
|
const formdataPartExample = (0, _schemaUtils.generateExample)('', fieldSchema.example ? fieldSchema.example : '', fieldSchema, 'json', false, true, 'text', true);
|
|
378
|
-
formDataTableRows.push((0, _litElement.html)` <tr> <td style="width:160px;min-width:100px"> <div class="param-name ${fieldSchema.deprecated ? 'deprecated' : ''}"> ${fieldName}${!fieldSchema.deprecated && (schema.required && schema.required.includes(fieldName) || fieldSchema.required) ? (0, _litElement.html)`<span style="color:var(--red)">*</span>` : ''} </div> <div class="param-type">${paramSchema.type}</div> </td> <td style="${fieldType === 'object' ? 'width:100%; padding:0;' : this.allowTry === 'true' ? '' : 'display:none;'} min-width:100px" colspan="${fieldType === 'object' ? 2 : 1}"> ${fieldType === 'array' ? fieldSchema.items && fieldSchema.items.format === 'binary' ? (0, _litElement.html)` <div class="file-input-container col" style="align-items:flex-end" @click="${e => this.onAddRemoveFileInput(e, fieldName, mimeType)}"> <div class="input-set row"> <input type="file" part="file-input" style="width:100%" data-pname="${fieldName}" data-ptype="${mimeType.includes('form-urlencode') ? 'form-urlencode' : 'form-data'}" data-array="false" data-file-array="true"> <button class="file-input-remove-btn"> ✕ </button> </div> <button class="m-btn primary file-input-add-btn" part="btn btn-fill" style="margin:2px 25px 0 0;padding:2px 6px">ADD</button> </div> ` : (0, _litElement.html)` <tag-input style="width:100%" data-ptype="${mimeType.includes('form-urlencode') ? 'form-urlencode' : 'form-data'}" data-pname="${fieldName}" data-default="${paramSchema.default || ''}" data-array="true" placeholder="${(Array.isArray(paramSchema.example) ? paramSchema.example[0] : paramSchema.example) || 'add-multiple
|
|
378
|
+
formDataTableRows.push((0, _litElement.html)` <tr> <td style="width:160px;min-width:100px"> <div class="param-name ${fieldSchema.deprecated ? 'deprecated' : ''}"> ${fieldName}${!fieldSchema.deprecated && (schema.required && schema.required.includes(fieldName) || fieldSchema.required) ? (0, _litElement.html)`<span style="color:var(--red)">*</span>` : ''} </div> <div class="param-type"> ${paramSchema.type === 'array' ? (0, _litElement.html)`[<span>${paramSchema.format || paramSchema.type}</span>]` : `${paramSchema.format || paramSchema.type}`} </div> </td> <td style="${fieldType === 'object' ? 'width:100%; padding:0;' : this.allowTry === 'true' ? '' : 'display:none;'} min-width:100px" colspan="${fieldType === 'object' ? 2 : 1}"> ${fieldType === 'array' ? fieldSchema.items && fieldSchema.items.format === 'binary' ? (0, _litElement.html)` <div class="file-input-container col" style="align-items:flex-end" @click="${e => this.onAddRemoveFileInput(e, fieldName, mimeType)}"> <div class="input-set row"> <input type="file" part="file-input" style="width:100%" data-pname="${fieldName}" data-ptype="${mimeType.includes('form-urlencode') ? 'form-urlencode' : 'form-data'}" data-array="false" data-file-array="true"> <button class="file-input-remove-btn"> ✕ </button> </div> <button class="m-btn primary file-input-add-btn" part="btn btn-fill" style="margin:2px 25px 0 0;padding:2px 6px">ADD</button> </div> ` : (0, _litElement.html)` <tag-input style="width:100%" data-ptype="${mimeType.includes('form-urlencode') ? 'form-urlencode' : 'form-data'}" data-pname="${fieldName}" data-default="${paramSchema.default || ''}" data-array="true" placeholder="${(Array.isArray(paramSchema.example) ? paramSchema.example[0] : paramSchema.example) || 'add-multiple ↩'}" .value="${paramSchema.default || ''}"> </tag-input> ` : (0, _litElement.html)` ${fieldType === 'object' ? (0, _litElement.html)` <div class="tab-panel row" style="min-height:300px;border-left:6px solid var(--light-border-color);align-items:stretch"> <div style="width:24px;background-color:var(--light-border-color)"> <div class="row" style="flex-direction:row-reverse;width:260px;height:24px;transform:rotate(270deg) translateX(-260px);transform-origin:top left;display:block" @click="${e => {
|
|
379
379
|
if (e.target.classList.contains('v-tab-btn')) {
|
|
380
380
|
const tab = e.target.dataset.tab;
|
|
381
381
|
|
|
@@ -399,7 +399,7 @@ class ApiRequest extends _litElement.LitElement {
|
|
|
399
399
|
if (e.target.tagName.toLowerCase() === 'button') {
|
|
400
400
|
this.activeSchemaTab = e.target.dataset.tab;
|
|
401
401
|
}
|
|
402
|
-
}}"> <button class="v-tab-btn ${this.activeSchemaTab === 'model' ? 'active' : ''}" data-tab="model">MODEL</button> <button class="v-tab-btn ${this.activeSchemaTab === 'body' ? 'active' : ''}" data-tab="body">REQUEST BODY</button> </div> </div> ${(0, _litElement.html)` <div class="tab-content col" data-tab="model" style="display:${this.activeSchemaTab === 'model' ? 'block' : 'none'};padding-left:5px;width:100%"> <schema-tree .data="${formdataPartSchema}" schema-expand-level="${this.schemaExpandLevel}"> </schema-tree> </div>`} ${(0, _litElement.html)` <div class="tab-content col" data-tab="
|
|
402
|
+
}}"> <button class="v-tab-btn ${this.activeSchemaTab === 'model' ? 'active' : ''}" data-tab="model">MODEL</button> <button class="v-tab-btn ${this.activeSchemaTab === 'body' ? 'active' : ''}" data-tab="body">REQUEST BODY</button> </div> </div> ${(0, _litElement.html)` <div class="tab-content col" data-tab="model" style="display:${this.activeSchemaTab === 'model' ? 'block' : 'none'};padding-left:5px;width:100%"> <schema-tree .data="${formdataPartSchema}" schema-expand-level="${this.schemaExpandLevel}"> </schema-tree> </div>`} ${(0, _litElement.html)` <div class="tab-content col" data-tab="body" style="display:${this.activeSchemaTab === 'body' ? 'block' : 'none'};padding-left:5px;width:100%"> <textarea class="textarea" placeholder="${formdataPartExample[0] && formdataPartExample[0].exampleValue || paramSchema.default || ''}" part="textarea textarea-param" style="width:100%;border:none;resize:vertical" data-array="false" data-ptype="${mimeType.includes('form-urlencode') ? 'form-urlencode' : 'form-data'}" data-pname="${fieldName}" data-default="${paramSchema.default || ''}" spellcheck="false">${this.fillRequestWithDefault === 'true' ? paramSchema.default : ''}</textarea> <textarea data-pname="hidden-${fieldName}" data-ptype="${mimeType.includes('form-urlencode') ? 'hidden-form-urlencode' : 'hidden-form-data'}" class="is-hidden" style="display:none">${paramSchema.default}</textarea> </div>`} </div>` : (0, _litElement.html)` ${this.allowTry === 'true' ? (0, _litElement.html)`<input placeholder="${paramSchema.example || paramSchema.default || ''}" .value="${this.fillRequestWithDefault === 'true' ? paramSchema.default || '' : ''}" spellcheck="false" type="${fieldSchema.format === 'binary' ? 'file' : fieldSchema.format === 'password' ? 'password' : 'text'}" part="textbox textbox-param" style="width:100%" data-ptype="${mimeType.includes('form-urlencode') ? 'form-urlencode' : 'form-data'}" data-pname="${fieldName}" data-default="${paramSchema.default || ''}" data-array="false">` : ''} `}`} </td> ${fieldType === 'object' ? '' : (0, _litElement.html)` <td> ${paramSchema.default || paramSchema.constraint || paramSchema.allowedValues || paramSchema.pattern ? (0, _litElement.html)` <div class="param-constraint"> ${paramSchema.pattern ? (0, _litElement.html)`<span style="font-weight:700">Pattern: </span>${paramSchema.pattern}<br>` : ''} ${paramSchema.constraint ? (0, _litElement.html)`<span style="font-weight:700">Constraints: </span>${paramSchema.constraint}<br>` : ''} ${paramSchema.allowedValues && paramSchema.allowedValues.split('┃').map((v, i) => (0, _litElement.html)` ${i > 0 ? '|' : (0, _litElement.html)`<span style="font-weight:700">Allowed: </span>`} ${(0, _litElement.html)` <a part="anchor anchor-param-constraint" class="${this.allowTry === 'true' ? '' : 'inactive-link'}" data-type="${paramSchema.type === 'array' ? paramSchema.type : 'string'}" data-enum="${v.trim()}" @click="${e => {
|
|
403
403
|
const inputEl = e.target.closest('table').querySelector(`[data-pname="${fieldName}"]`);
|
|
404
404
|
|
|
405
405
|
if (inputEl) {
|
|
@@ -64,7 +64,7 @@ class SchemaTable extends _litElement.LitElement {
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
render() {
|
|
67
|
-
return (0, _litElement.html)`
|
|
67
|
+
return (0, _litElement.html)` ${this.data && this.data['::description'] ? (0, _litElement.html)`<span class="m-markdown" style="padding-bottom:8px"> ${(0, _unsafeHtml.unsafeHTML)((0, _marked.marked)(this.data['::description'] || ''))}</span>` : ''} <div class="table"> <div style="border:1px solid var(--light-border-color)"> <div style="display:flex;background-color:var(--bg2);padding:8px 4px;border-bottom:1px solid var(--light-border-color)"> <div class="key" style="font-family:var(--font-regular);font-weight:700;color:var(--fg)"> Field </div> <div class="key-type" style="font-family:var(--font-regular);font-weight:700;color:var(--fg)"> Type </div> <div class="key-descr" style="font-family:var(--font-regular);font-weight:700;color:var(--fg)"> Description </div> </div> ${this.data ? (0, _litElement.html)`${this.generateTree(this.data['::type'] === 'array' ? this.data['::props'] : this.data, this.data['::type'])}` : ''} </div> </div> `;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
generateTree(data, dataType = 'object', key = '', description = '', schemaLevel = 0, indentLevel = 0) {
|
|
@@ -122,12 +122,14 @@ class SchemaTable extends _litElement.LitElement {
|
|
|
122
122
|
return undefined;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
const displayLine = [flags['🆁'] || flags['🆆'], description].filter(v => v).join(' ');
|
|
126
|
+
return (0, _litElement.html)` ${newSchemaLevel >= 0 && key ? (0, _litElement.html)` <div class="tr ${newSchemaLevel <= this.schemaExpandLevel ? 'expanded' : 'collapsed'} ${data['::type']}" data-obj="${keyLabel}"> <div class="td key ${data['::deprecated'] ? 'deprecated' : ''}" style="padding-left:${leftPadding}px"> ${keyLabel || keyDescr ? (0, _litElement.html)` <span class="obj-toggle ${newSchemaLevel < this.schemaExpandLevel ? 'expanded' : 'collapsed'}" data-obj="${keyLabel}" @click="${e => this.toggleObjectExpand(e, keyLabel)}"> ${schemaLevel < this.schemaExpandLevel ? '-' : '+'} </span>` : ''} ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION') ? (0, _litElement.html)`<span class="xxx-of-key" style="margin-left:-6px">${keyLabel}</span><span class="${isOneOfLabel ? 'xxx-of-key' : 'xxx-of-descr'}">${keyDescr}</span>` : keyLabel.endsWith('*') ? (0, _litElement.html)`<span class="key-label" style="display:inline-block;margin-left:-6px"> ${keyLabel.substring(0, keyLabel.length - 1)}</span><span style="color:var(--red)">*</span>` : (0, _litElement.html)`<span class="key-label" style="display:inline-block;margin-left:-6px">${keyLabel === '::props' ? '' : keyLabel}</span>`} ${data['::type'] === 'xxx-of' && dataType === 'array' ? (0, _litElement.html)`<span style="color:var(--primary-color)">ARRAY</span>` : ''} </div> <div class="td key-type">${(data['::type'] || '').includes('xxx-of') ? '' : detailObjType}</div> <div class="td key-descr m-markdown-small" style="line-height:1.7">${(0, _unsafeHtml.unsafeHTML)((0, _marked.marked)(displayLine))}</div> </div>` : (0, _litElement.html)` ${data['::type'] === 'array' && dataType === 'array' ? (0, _litElement.html)`<div class="tr"> <div class="td"> ${dataType} </div> </div>` : ''} `} <div class="object-body"> ${Array.isArray(data) && data[0] ? (0, _litElement.html)`${this.generateTree(data[0], 'xxx-of-option', '::ARRAY~OF', '', newSchemaLevel, newIndentLevel)}` : (0, _litElement.html)` ${Object.keys(data).map(dataKey => !['::title', '::description', '::type', '::props', '::deprecated', '::array-type', '::dataTypeLabel', '::flags'].includes(dataKey) || data[dataKey]['::type'] === 'array' && data[dataKey]['::type'] === 'object' ? (0, _litElement.html)`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel)}` : '')}`} <div> </div></div>`;
|
|
126
127
|
} // For Primitive Data types
|
|
127
128
|
|
|
128
129
|
|
|
129
130
|
const {
|
|
130
131
|
type,
|
|
132
|
+
format,
|
|
131
133
|
readOrWriteOnly,
|
|
132
134
|
constraint,
|
|
133
135
|
defaultValue,
|
|
@@ -148,7 +150,7 @@ class SchemaTable extends _litElement.LitElement {
|
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
const dataTypeCss = type.replace(/┃.*/g, '').replace(/[^a-zA-Z0-9+]/g, '').substring(0, 4).toLowerCase();
|
|
151
|
-
return (0, _litElement.html)` <div class="tr primitive"> <div class="td key ${deprecated ? 'deprecated' : ''}" style="padding-left:${leftPadding}px"> ${keyLabel && keyLabel.endsWith('*') ? (0, _litElement.html)`<span class="key-label">${keyLabel.substring(0, keyLabel.length - 1)}</span><span style="color:var(--red)">*</span>` : key.startsWith('::OPTION') ? (0, _litElement.html)`<span class="xxx-of-key">${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : (0, _litElement.html)`${keyLabel ? (0, _litElement.html)`<span class="key-label"> ${keyLabel}</span>` : (0, _litElement.html)`<span class="xxx-of-descr">${schemaTitle}</span>`}`} </div> <div class="td key-type ${dataTypeCss}"
|
|
153
|
+
return (0, _litElement.html)` <div class="tr primitive"> <div class="td key ${deprecated ? 'deprecated' : ''}" style="padding-left:${leftPadding}px"> ${keyLabel && keyLabel.endsWith('*') ? (0, _litElement.html)`<span class="key-label">${keyLabel.substring(0, keyLabel.length - 1)}</span><span style="color:var(--red)">*</span>` : key.startsWith('::OPTION') ? (0, _litElement.html)`<span class="xxx-of-key">${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : (0, _litElement.html)`${keyLabel ? (0, _litElement.html)`<span class="key-label"> ${keyLabel}</span>` : (0, _litElement.html)`<span class="xxx-of-descr">${schemaTitle}</span>`}`} </div> <div class="td key-type"> <span>${dataType === 'array' ? '[' : ''}<span class="${dataTypeCss}">${format || type}</span>${dataType === 'array' ? ']' : ''}</span> <span class="${dataTypeCss}" style="font-family:var(--font-mono)" title="${readOrWriteOnly === '🆁' && 'Read only attribute' || readOrWriteOnly === '🆆' && 'Write only attribute' || ''}"> ${readOrWriteOnly} </span> </div> <div class="td key-descr"> ${dataType === 'array' ? (0, _litElement.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, _litElement.html)` ${constraint ? (0, _litElement.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${constraint}</div><br>` : ''} ${defaultValue ? (0, _litElement.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Default: </span>${defaultValue}</div><br>` : ''} ${allowedValues ? (0, _litElement.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Allowed: </span>${allowedValues}</div><br>` : ''} ${pattern ? (0, _litElement.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Pattern: </span>${pattern}</div><br>` : ''} ${example ? (0, _litElement.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Example: </span>${example}</div><br>` : ''}` : ''} </div> </div> `;
|
|
152
154
|
}
|
|
153
155
|
/* eslint-enable indent */
|
|
154
156
|
|
|
@@ -66,7 +66,7 @@ class SchemaTree extends _litElement.LitElement {
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
render() {
|
|
69
|
-
return (0, _litElement.html)` <div class="tree"> <div class="toolbar"> ${this.data && this.data['::description'] ? (0, _litElement.html)`<span class="m-markdown" style="margin-block-start:0"> ${(0, _unsafeHtml.unsafeHTML)((0, _marked.marked)(this.data['::description'] || ''))}</span>` : (0, _litElement.html)`<div> </div>`} <div class="toolbar-item" @click="${() => this.toggleSchemaDescription()}"> ${this.schemaDescriptionExpanded ? 'Collapse
|
|
69
|
+
return (0, _litElement.html)` <div class="tree"> <div class="toolbar"> ${this.data && this.data['::description'] ? (0, _litElement.html)`<span class="m-markdown" style="margin-block-start:0"> ${(0, _unsafeHtml.unsafeHTML)((0, _marked.marked)(this.data['::description'] || ''))}</span>` : (0, _litElement.html)`<div> </div>`} <div class="toolbar-item" @click="${() => this.toggleSchemaDescription()}"> ${this.schemaDescriptionExpanded ? 'Collapse' : 'Expand'} </div> </div> ${this.data ? (0, _litElement.html)`${this.generateTree(this.data['::type'] === 'array' ? this.data['::props'] : this.data, this.data['::type'], this.data['::array-type'] || '')}` : (0, _litElement.html)`<span class="mono-font" style="color:var(--red)"> Schema not found </span>`} </div> `;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
toggleSchemaDescription() {
|
|
@@ -74,9 +74,9 @@ class SchemaTree extends _litElement.LitElement {
|
|
|
74
74
|
this.requestUpdate();
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
generateTree(data, dataType = 'object', key = '', description = '', schemaLevel = 0, indentLevel = 0) {
|
|
77
|
+
generateTree(data, dataType = 'object', arrayType = '', flags = {}, key = '', description = '', schemaLevel = 0, indentLevel = 0) {
|
|
78
78
|
if (!data) {
|
|
79
|
-
return (0, _litElement.html)`<div class="null" style="display:inline">
|
|
79
|
+
return (0, _litElement.html)`<div class="null" style="display:inline"> <span class="key-label xxx-of-key"> ${key.replace('::OPTION~', '')}</span> ${dataType === 'array' ? (0, _litElement.html)`<span class="mono-font"> [ ] </span>` : dataType === 'object' ? (0, _litElement.html)`<span class="mono-font"> { } </span>` : (0, _litElement.html)`<span class="mono-font"> schema undefined </span>`} </div>`;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
if (Object.keys(data).length === 0) {
|
|
@@ -101,9 +101,8 @@ class SchemaTree extends _litElement.LitElement {
|
|
|
101
101
|
const minFieldColWidth = 250 - indentLevel * leftPadding;
|
|
102
102
|
let openBracket = '';
|
|
103
103
|
let closeBracket = '';
|
|
104
|
-
const newSchemaLevel = data['::type'] && data['::type'].startsWith('xxx-of') ? schemaLevel : schemaLevel + 1;
|
|
105
|
-
|
|
106
|
-
const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' || key.startsWith('::OPTION') ? indentLevel : indentLevel + 1;
|
|
104
|
+
const newSchemaLevel = data['::type'] && data['::type'].startsWith('xxx-of') ? schemaLevel : schemaLevel + 1;
|
|
105
|
+
const newIndentLevel = dataType === 'xxx-of-option' || data['::type'] === 'xxx-of-option' ? indentLevel : indentLevel + 1;
|
|
107
106
|
|
|
108
107
|
if (data['::type'] === 'object') {
|
|
109
108
|
if (dataType === 'array') {
|
|
@@ -125,10 +124,12 @@ class SchemaTree extends _litElement.LitElement {
|
|
|
125
124
|
}
|
|
126
125
|
} else if (data['::type'] === 'array') {
|
|
127
126
|
if (dataType === 'array') {
|
|
127
|
+
const arrType = arrayType !== 'object' ? arrayType : '';
|
|
128
|
+
|
|
128
129
|
if (schemaLevel < this.schemaExpandLevel) {
|
|
129
|
-
openBracket = (0, _litElement.html)`<span class="open-bracket array-of-array" @click="${this.toggleObjectExpand}">[[</span>`;
|
|
130
|
+
openBracket = (0, _litElement.html)`<span class="open-bracket array-of-array" data-array-type="${arrType}" @click="${this.toggleObjectExpand}">[[ ${arrType} </span>`;
|
|
130
131
|
} else {
|
|
131
|
-
openBracket = (0, _litElement.html)`<span class="open-bracket array-of-array" @click="${this.toggleObjectExpand}">[[...]]</span>`;
|
|
132
|
+
openBracket = (0, _litElement.html)`<span class="open-bracket array-of-array" data-array-type="${arrType}" @click="${this.toggleObjectExpand}">[[...]]</span>`;
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
closeBracket = ']]';
|
|
@@ -144,8 +145,6 @@ class SchemaTree extends _litElement.LitElement {
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
if (typeof data === 'object') {
|
|
147
|
-
const flags = data['::flags'] || {};
|
|
148
|
-
|
|
149
148
|
if (flags['🆁'] && this.schemaHideReadOnly === 'true') {
|
|
150
149
|
return undefined;
|
|
151
150
|
}
|
|
@@ -155,12 +154,13 @@ class SchemaTree extends _litElement.LitElement {
|
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
const displayLine = [flags['🆁'] || flags['🆆'], description].filter(v => v).join(' ');
|
|
158
|
-
return (0, _litElement.html)` <div class="tr ${schemaLevel < this.schemaExpandLevel || data['::type'] && data['::type'].startsWith('xxx-of') ? 'expanded' : 'collapsed'} ${data['::type'] || 'no-type-info'}"> <div class="td key ${data['::deprecated'] ? 'deprecated' : ''}" style="min-width:${minFieldColWidth}px"> ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION') ? (0, _litElement.html)`<span class="key-label xxx-of-key">${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : keyLabel
|
|
157
|
+
return (0, _litElement.html)` <div class="tr ${schemaLevel < this.schemaExpandLevel || data['::type'] && data['::type'].startsWith('xxx-of') ? 'expanded' : 'collapsed'} ${data['::type'] || 'no-type-info'}"> <div class="td key ${data['::deprecated'] ? 'deprecated' : ''}" style="min-width:${minFieldColWidth}px"> ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION') ? (0, _litElement.html)`<span class="key-label xxx-of-key">${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : keyLabel === '::props' || keyLabel === '::ARRAY~OF' ? '' : schemaLevel > 0 ? (0, _litElement.html)`<span class="key-label"> ${keyLabel.replace(/\*$/, '')}${keyLabel.endsWith('*') ? (0, _litElement.html)`<span style="color:var(--red)">*</span>:` : ''}: </span>` : ''} ${data['::type'] === 'xxx-of' && dataType === 'array' ? (0, _litElement.html)`<span style="color:var(--primary-color)">ARRAY</span>` : ''} ${openBracket} </div> <div class="td key-descr"> <span class="m-markdown-small" style="font-family:var(--font-mono);vertical-align:middle" title="${flags['🆁'] && 'Read only attribute' || flags['🆆'] && 'Write only attribute' || ''}"> ${(0, _unsafeHtml.unsafeHTML)((0, _marked.marked)(displayLine))} </span> </div> </div> <div class="inside-bracket ${data['::type'] || 'no-type-info'}" style="padding-left:${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' ? 0 : leftPadding}px"> ${Array.isArray(data) && data[0] ? (0, _litElement.html)`${this.generateTree(data[0], 'xxx-of-option', '', data[0]['::flags'] || {}, '::ARRAY~OF', '', newSchemaLevel, newIndentLevel)}` : (0, _litElement.html)` ${Object.keys(data).map(dataKey => !['::title', '::description', '::type', '::props', '::deprecated', '::array-type', '::dataTypeLabel', '::flags'].includes(dataKey) || data[dataKey]['::type'] === 'array' && data[dataKey]['::type'] === 'object' ? (0, _litElement.html)`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], data[dataKey]['::array-type'] || '', data[dataKey]['::flags'], dataKey, data[dataKey]['::description'], newSchemaLevel, newIndentLevel)}` : '')}`} </div> ${data['::type'] && data['::type'].includes('xxx-of') ? '' : (0, _litElement.html)`<div class="close-bracket"> ${closeBracket} </div>`} `;
|
|
159
158
|
} // For Primitive Data types
|
|
160
159
|
|
|
161
160
|
|
|
162
161
|
const {
|
|
163
162
|
type,
|
|
163
|
+
format,
|
|
164
164
|
readOrWriteOnly,
|
|
165
165
|
constraint,
|
|
166
166
|
defaultValue,
|
|
@@ -181,7 +181,7 @@ class SchemaTree extends _litElement.LitElement {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
const dataTypeCss = type.replace(/┃.*/g, '').replace(/[^a-zA-Z0-9+]/g, '').substring(0, 4).toLowerCase();
|
|
184
|
-
return (0, _litElement.html)` <div class="tr primitive"> <div class="td key ${deprecated ? 'deprecated' : ''}" style="min-width:${minFieldColWidth}px"> ${keyLabel.endsWith('*') ? (0, _litElement.html)`<span class="key-label">${keyLabel.substring(0, keyLabel.length - 1)}</span><span style="color:var(--red)">*</span>:` : key.startsWith('::OPTION') ? (0, _litElement.html)`<span class="key-label xxx-of-key">${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : schemaLevel > 0 ? (0, _litElement.html)`<span class="key-label">${keyLabel}:</span>` : ''} <span class="${dataTypeCss}"
|
|
184
|
+
return (0, _litElement.html)` <div class="tr primitive"> <div class="td key ${deprecated ? 'deprecated' : ''}" style="min-width:${minFieldColWidth}px"> ${keyLabel.endsWith('*') ? (0, _litElement.html)`<span class="key-label">${keyLabel.substring(0, keyLabel.length - 1)}</span><span style="color:var(--red)">*</span>:` : key.startsWith('::OPTION') ? (0, _litElement.html)`<span class="key-label xxx-of-key">${keyLabel}</span><span class="xxx-of-descr">${keyDescr}</span>` : schemaLevel > 0 ? (0, _litElement.html)`<span class="key-label">${keyLabel}:</span>` : ''} <span>${dataType === 'array' ? '[' : ''}<span class="${dataTypeCss}">${format || type}</span>${dataType === 'array' ? ']' : ''}</span> </div> <div class="td key-descr"> <span class="m-markdown-small" style="font-family:var(--font-mono);vertical-align:middle" title="${readOrWriteOnly === '🆁' && 'Read only attribute' || readOrWriteOnly === '🆆' && 'Write only attribute' || ''}"> ${(0, _unsafeHtml.unsafeHTML)((0, _marked.marked)(`${readOrWriteOnly && `${readOrWriteOnly} ` || ''}${dataType === 'array' && description || `${schemaTitle ? `**${schemaTitle}:**` : ''} ${schemaDescription}` || ''}`))} </span> ${this.schemaDescriptionExpanded ? (0, _litElement.html)` ${constraint ? (0, _litElement.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${constraint}</div><br>` : ''} ${defaultValue ? (0, _litElement.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Default: </span>${defaultValue}</div><br>` : ''} ${allowedValues ? (0, _litElement.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Allowed: </span>${allowedValues}</div><br>` : ''} ${pattern ? (0, _litElement.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Pattern: </span>${pattern}</div><br>` : ''} ${example ? (0, _litElement.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Example: </span>${example}</div><br>` : ''}` : ''} </div> </div> `;
|
|
185
185
|
}
|
|
186
186
|
/* eslint-enable indent */
|
|
187
187
|
|
|
@@ -5,6 +5,6 @@ exports.default = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _litElement = require("lit-element");
|
|
7
7
|
|
|
8
|
-
var _default = (0, _litElement.css)`.hover-bg:hover{background:var(--bg3)}::selection{background:var(--selection-bg);color:var(--selection-fg)}.regular-font{font-family:var(--font-regular)}.mono-font{font-family:var(--font-mono)}.title{font-size:calc(var(--font-size-small) + 18px);font-weight:400}.sub-title{font-size:20px}.req-res-title{font-family:var(--font-regular);font-size:calc(var(--font-size-small) + 4px);font-weight:700}.tiny-title{font-size:calc(var(--font-size-small) + 1px);font-weight:700}.regular-font-size{font-size:var(--font-size-regular)}.small-font-size{font-size:var(--font-size-small)}.upper{text-transform:uppercase}.primary-text{color:var(--primary-color)}.bold-text{font-weight:700}.gray-text{color:var(--light-fg)}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.multiline{overflow:scroll;max-height:var(--resp-area-height,300px);color:var(--fg3)}.method-fg.put{color:var(--orange)}.method-fg.post{color:var(--green)}.method-fg.get,.method-fg.head{color:var(--blue)}.method-fg.delete{color:var(--red)}.method-fg.options{color:var(--purple)}.method-fg.patch{color:var(--yellow)}h1{font-family:var(--font-regular);font-size:28px;padding-top:10px;letter-spacing:normal;font-weight:400}h2{font-family:var(--font-regular);font-size:24px;padding-top:10px;letter-spacing:normal;font-weight:400}h3{font-family:var(--font-regular);font-size:18px;padding-top:10px;letter-spacing:normal;font-weight:400}h4{font-family:var(--font-regular);font-size:16px;padding-top:10px;letter-spacing:normal;font-weight:400}h5{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h6{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h1,h2,h3,h4,h5{margin-block-end:.2em}h3{margin-top:0}p{margin-block-start:.5em}a{color:var(--blue);cursor:pointer}a.inactive-link{color:var(--fg);text-decoration:none;cursor:text}code,pre{margin:0;font-family:var(--font-mono);font-size:calc(var(--font-size-mono) - 1px)}.m-markdown,.m-markdown-small{display:block}.m-markdown li,.m-markdown p,.m-markdown span{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 6px)}.m-markdown-small li,.m-markdown-small p,.m-markdown-small span{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 6px)}.m-markdown p:not(:first-child){margin-block-start:
|
|
8
|
+
var _default = (0, _litElement.css)`.hover-bg:hover{background:var(--bg3)}::selection{background:var(--selection-bg);color:var(--selection-fg)}.regular-font{font-family:var(--font-regular)}.mono-font{font-family:var(--font-mono)}.title{font-size:calc(var(--font-size-small) + 18px);font-weight:400}.sub-title{font-size:20px}.req-res-title{font-family:var(--font-regular);font-size:calc(var(--font-size-small) + 4px);font-weight:700}.tiny-title{font-size:calc(var(--font-size-small) + 1px);font-weight:700}.regular-font-size{font-size:var(--font-size-regular)}.small-font-size{font-size:var(--font-size-small)}.upper{text-transform:uppercase}.primary-text{color:var(--primary-color)}.bold-text{font-weight:700}.gray-text{color:var(--light-fg)}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.multiline{overflow:scroll;max-height:var(--resp-area-height,300px);color:var(--fg3)}.method-fg.put{color:var(--orange)}.method-fg.post{color:var(--green)}.method-fg.get,.method-fg.head{color:var(--blue)}.method-fg.delete{color:var(--red)}.method-fg.options{color:var(--purple)}.method-fg.patch{color:var(--yellow)}h1{font-family:var(--font-regular);font-size:28px;padding-top:10px;letter-spacing:normal;font-weight:400}h2{font-family:var(--font-regular);font-size:24px;padding-top:10px;letter-spacing:normal;font-weight:400}h3{font-family:var(--font-regular);font-size:18px;padding-top:10px;letter-spacing:normal;font-weight:400}h4{font-family:var(--font-regular);font-size:16px;padding-top:10px;letter-spacing:normal;font-weight:400}h5{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h6{font-family:var(--font-regular);font-size:14px;padding-top:10px;letter-spacing:normal;font-weight:400}h1,h2,h3,h4,h5{margin-block-end:.2em}h3{margin-top:0}p{margin-block-start:.5em}a{color:var(--blue);cursor:pointer}a.inactive-link{color:var(--fg);text-decoration:none;cursor:text}code,pre{margin:0;font-family:var(--font-mono);font-size:calc(var(--font-size-mono) - 1px)}.m-markdown,.m-markdown-small{display:block}.m-markdown li,.m-markdown p,.m-markdown span{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 6px)}.m-markdown-small li,.m-markdown-small p,.m-markdown-small span{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 6px)}.m-markdown p:not(:first-child){margin-block-start:12px}.m-markdown-small p:not(:first-child){margin-block-start:12px}.m-markdown :first-child,.m-markdown-small :first-child{margin-block-start:0}.m-markdown p,.m-markdown-small p{margin-block-end:0}.toolbar .m-markdown p,.toolbar .m-markdown-small p{margin-block-start:0}.m-markdown code span{font-size:var(--font-size-mono)}.m-markdown code,.m-markdown-small code{padding:1px 6px;border-radius:2px;color:var(--inline-code-fg);background-color:var(--bg3);font-size:calc(var(--font-size-mono));line-height:1.2}.m-markdown-small code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown pre,.m-markdown-small pre{white-space:pre-wrap;overflow-x:auto;line-height:normal;border-radius:2px;border:1px solid var(--code-border-color)}.m-markdown pre{padding:8px;background-color:var(--code-bg);color:var(--code-fg)}.m-markdown-small pre{margin-top:4px;padding:2px 4px;background-color:var(--bg3);color:var(--fg2)}.m-markdown pre code,.m-markdown-small pre code{border:none;padding:0}.m-markdown pre code{color:var(--code-fg);background-color:var(--code-bg);background-color:transparent}.m-markdown-small pre code{color:var(--fg2);background-color:var(--bg3)}.m-markdown ol,.m-markdown ul{padding-inline-start:30px}.m-markdown-small ol,.m-markdown-small ul{padding-inline-start:20px}.m-markdown a,.m-markdown-small a{color:var(--blue)}.m-markdown img,.m-markdown-small img{max-width:100%}.m-markdown table,.m-markdown-small table{border-spacing:0;margin:10px 0;border-collapse:separate;border:1px solid var(--border-color);border-radius:var(--border-radius);font-size:calc(var(--font-size-small) + 1px);line-height:calc(var(--font-size-small) + 4px);max-width:100%}.m-markdown-small table{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 2px);margin:8px 0}.m-markdown td,.m-markdown th,.m-markdown-small td,.m-markdown-small th{vertical-align:top;border-top:1px solid var(--border-color);line-height:calc(var(--font-size-small) + 4px)}.m-markdown tr:first-child th,.m-markdown-small tr:first-child th{border-top:0 none}.m-markdown td,.m-markdown th{padding:10px 12px}.m-markdown-small td,.m-markdown-small th{padding:8px 8px}.m-markdown th,.m-markdown-small th{font-weight:600;background-color:var(--bg2);vertical-align:middle}.m-markdown-small table code{font-size:calc(var(--font-size-mono) - 2px)}.m-markdown table code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown blockquote,.m-markdown-small blockquote{margin-inline-start:0;margin-inline-end:0;border-left:3px solid var(--border-color);padding:6px 0 6px 6px}`;
|
|
9
9
|
|
|
10
10
|
exports.default = _default;
|
|
@@ -5,6 +5,6 @@ exports.default = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _litElement = require("lit-element");
|
|
7
7
|
|
|
8
|
-
var _default = (0, _litElement.css)`*,:after,:before{box-sizing:border-box}.tr{display:flex;flex:none;width:100%;box-sizing:content-box;border-bottom:1px dotted transparent}.td{display:block;flex:0 0 auto}.key{font-family:var(--font-mono);white-space:normal;word-break:break-all}.key-descr{font-family:var(--font-regular);flex-shrink:1;text-overflow:ellipsis;overflow:hidden;display:none;max-height:auto}.toolbar{display:none}.tr.xxx-of{border-top:1px dotted var(--primary-color)}.xxx-of-key{font-size:calc(var(--font-size-small) - 2px);font-weight:700;background-color:var(--primary-color);color:var(--primary-btn-text-color);border-radius:2px;line-height:calc(var(--font-size-small) + 6px);padding:0 5px;margin-bottom:1px;display:inline-block}.xxx-of-descr{font-family:var(--font-regular);
|
|
8
|
+
var _default = (0, _litElement.css)`*,:after,:before{box-sizing:border-box}.tr{display:flex;flex:none;width:100%;box-sizing:content-box;border-bottom:1px dotted transparent}.td{display:block;flex:0 0 auto}.key{font-family:var(--font-mono);white-space:normal;word-break:break-all}.key-descr{font-family:var(--font-regular);flex-shrink:1;text-overflow:ellipsis;overflow:hidden;display:none;max-height:auto}.toolbar{display:none}.tr.xxx-of{border-top:1px dotted var(--primary-color)}.xxx-of-key{font-size:calc(var(--font-size-small) - 2px);font-weight:700;background-color:var(--primary-color);color:var(--primary-btn-text-color);border-radius:2px;line-height:calc(var(--font-size-small) + 6px);padding:0 5px;margin-bottom:1px;display:inline-block}.xxx-of-descr{font-family:var(--font-regular);font-size:calc(var(--font-size-small) - 1px);margin-left:2px}.bina,.byte,.date,.emai,.host,.ipv4,.pass,.stri,.string,.uri,.url,.uuid{color:var(--green)}.deci .blue,.doub,.floa,.int3,.int6,.inte,.numb,.number{color:var(--blue)}.null{color:var(--red)}.bool,.boolean{color:var(--orange)}.enum{color:var(--yellow)}.tree .toolbar{display:flex;justify-content:space-between}.toolbar{width:100%}.toolbar-item{cursor:pointer;padding:5px 0 5px 1rem;margin:0 1rem!important;color:#38b3f9;flex-shrink:0}.tree .toolbar .toolbar-item{display:none}.schema-root-type{cursor:auto;color:var(--fg2);font-weight:700;text-transform:uppercase}.schema-root-type.xxx-of{display:none}.toolbar-item:first-of-type{margin:0 2px 0 0}@media only screen and (min-width:576px){.key-descr{display:block}.tree .toolbar .toolbar-item{display:block}.toolbar{display:flex}}`;
|
|
9
9
|
|
|
10
10
|
exports.default = _default;
|
|
@@ -20,6 +20,8 @@ const IS_MISSING_TYPE_INFO_TYPE = '';
|
|
|
20
20
|
/* Generates an schema object containing type and constraint info */
|
|
21
21
|
|
|
22
22
|
function getTypeInfo(schema) {
|
|
23
|
+
var _schema$items;
|
|
24
|
+
|
|
23
25
|
if (!schema) {
|
|
24
26
|
return undefined;
|
|
25
27
|
}
|
|
@@ -42,7 +44,7 @@ function getTypeInfo(schema) {
|
|
|
42
44
|
|
|
43
45
|
const info = {
|
|
44
46
|
type: dataType,
|
|
45
|
-
format: schema.format || '',
|
|
47
|
+
format: schema.format || ((_schema$items = schema.items) === null || _schema$items === void 0 ? void 0 : _schema$items.format) || '',
|
|
46
48
|
pattern: schema.pattern && !schema.enum ? schema.pattern : '',
|
|
47
49
|
readOrWriteOnly: schema.readOnly && '🆁' || schema.writeOnly && '🆆' || '',
|
|
48
50
|
deprecated: !!schema.deprecated,
|
|
@@ -98,6 +100,7 @@ function getTypeInfo(schema) {
|
|
|
98
100
|
info.constraint = constraint;
|
|
99
101
|
info.html = JSON.stringify({
|
|
100
102
|
type: info.type,
|
|
103
|
+
format: info.format,
|
|
101
104
|
readOrWriteOnly: info.readOrWriteOnly,
|
|
102
105
|
constraint: info.constraint,
|
|
103
106
|
defaultValue: info.default,
|
|
@@ -408,26 +411,44 @@ function schemaInObjectNotation(rawSchema, _, level = 0, suffix = '') {
|
|
|
408
411
|
return Object.assign({}, objWithAllProps, typeof obj === 'object' && !Array.isArray(obj) ? obj : {});
|
|
409
412
|
} else if (anyOf || oneOf) {
|
|
410
413
|
const objWithAnyOfProps = {};
|
|
414
|
+
let writeOnly = true;
|
|
415
|
+
let readOnly = true;
|
|
411
416
|
(anyOf || oneOf || []).forEach((v, index) => {
|
|
412
417
|
if (v.type === 'object' || v.properties || v.allOf || v.anyOf || v.oneOf) {
|
|
418
|
+
var _partialObj$Flags, _partialObj$Flags2;
|
|
419
|
+
|
|
413
420
|
const partialObj = schemaInObjectNotation(v, {});
|
|
414
421
|
objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`] = partialObj;
|
|
415
422
|
objWithAnyOfProps['::type'] = 'xxx-of-option';
|
|
423
|
+
readOnly && (readOnly = (_partialObj$Flags = partialObj['::flags']) === null || _partialObj$Flags === void 0 ? void 0 : _partialObj$Flags['🆁']);
|
|
424
|
+
writeOnly && (writeOnly = (_partialObj$Flags2 = partialObj['::flags']) === null || _partialObj$Flags2 === void 0 ? void 0 : _partialObj$Flags2['🆆']);
|
|
416
425
|
} else if (v.type === 'array' || v.items) {
|
|
426
|
+
var _partialObj$Flags3, _partialObj$Flags4;
|
|
427
|
+
|
|
417
428
|
// This else-if block never seems to get executed
|
|
418
429
|
const partialObj = schemaInObjectNotation(v, {});
|
|
419
430
|
objWithAnyOfProps[`::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`] = partialObj;
|
|
420
431
|
objWithAnyOfProps['::type'] = 'xxx-of-array';
|
|
432
|
+
readOnly && (readOnly = (_partialObj$Flags3 = partialObj['::flags']) === null || _partialObj$Flags3 === void 0 ? void 0 : _partialObj$Flags3['🆁']);
|
|
433
|
+
writeOnly && (writeOnly = (_partialObj$Flags4 = partialObj['::flags']) === null || _partialObj$Flags4 === void 0 ? void 0 : _partialObj$Flags4['🆆']);
|
|
421
434
|
} else {
|
|
435
|
+
var _objWithAnyOfProps$, _objWithAnyOfProps$2;
|
|
436
|
+
|
|
422
437
|
const prop = `::OPTION~${index + 1}${v.title ? `~${v.title}` : ''}`;
|
|
423
438
|
objWithAnyOfProps[prop] = `${getTypeInfo(v).html}`;
|
|
424
439
|
objWithAnyOfProps['::type'] = 'xxx-of-option';
|
|
440
|
+
readOnly && (readOnly = (_objWithAnyOfProps$ = objWithAnyOfProps['::flags']) === null || _objWithAnyOfProps$ === void 0 ? void 0 : _objWithAnyOfProps$['🆁']);
|
|
441
|
+
writeOnly && (writeOnly = (_objWithAnyOfProps$2 = objWithAnyOfProps['::flags']) === null || _objWithAnyOfProps$2 === void 0 ? void 0 : _objWithAnyOfProps$2['🆆']);
|
|
425
442
|
}
|
|
426
443
|
});
|
|
427
444
|
const obj = schemaInObjectNotation(schema, {}, 0);
|
|
428
445
|
const resultObj = typeof obj === 'object' && !Array.isArray(obj) ? obj : {};
|
|
429
446
|
resultObj[anyOf ? `::ANY~OF ${suffix}` : `::ONE~OF ${suffix}`] = objWithAnyOfProps;
|
|
430
447
|
resultObj['::type'] = 'xxx-of';
|
|
448
|
+
resultObj['::flags'] = {
|
|
449
|
+
'🆁': readOnly && '🆁',
|
|
450
|
+
'🆆': writeOnly && '🆆'
|
|
451
|
+
};
|
|
431
452
|
return resultObj;
|
|
432
453
|
} else if (Array.isArray(schema.type)) {
|
|
433
454
|
const obj = {}; // When a property has multiple types, then check further if any of the types are array or object, if yes then modify the schema using one-of
|
|
@@ -542,6 +563,8 @@ function schemaInObjectNotation(rawSchema, _, level = 0, suffix = '') {
|
|
|
542
563
|
|
|
543
564
|
return obj;
|
|
544
565
|
} else if (schema.type === 'array' || schema.items) {
|
|
566
|
+
var _schema$items2;
|
|
567
|
+
|
|
545
568
|
// If Array
|
|
546
569
|
const obj = {};
|
|
547
570
|
obj['::title'] = schema.title || '';
|
|
@@ -557,6 +580,11 @@ function schemaInObjectNotation(rawSchema, _, level = 0, suffix = '') {
|
|
|
557
580
|
readOnly: schema.readOnly,
|
|
558
581
|
writeOnly: schema.writeOnly
|
|
559
582
|
}, schema.items), {}, level + 1);
|
|
583
|
+
|
|
584
|
+
if ((_schema$items2 = schema.items) !== null && _schema$items2 !== void 0 && _schema$items2.items) {
|
|
585
|
+
obj['::array-type'] = schema.items.items.type;
|
|
586
|
+
}
|
|
587
|
+
|
|
560
588
|
return obj;
|
|
561
589
|
}
|
|
562
590
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-explorer",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.383",
|
|
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
|
"repository": {
|