openapi-explorer 2.1.658 → 2.1.659

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.
@@ -106,7 +106,7 @@ export default class SchemaTable extends LitElement {
106
106
  } else if (data['::type']) {
107
107
  displaySchemaLink = data['::link'];
108
108
  if (dataType === 'array') {
109
- detailObjType = `[${data['::link']}]`; // Array of Object
109
+ detailObjType = data['::link'] || keyLabel.replace(/(s|Collection|List)[*]?$/i, ''); // Array of Object
110
110
  } else {
111
111
  detailObjType = data['::link'] || data['::type'];
112
112
  }
@@ -121,7 +121,7 @@ export default class SchemaTable extends LitElement {
121
121
  return undefined;
122
122
  }
123
123
  const displayLine = [title && `**${title}${description ? ':' : ''}**`, description].filter(v => v).join(' ');
124
- return html` ${newSchemaLevel >= 0 && key ? html` <div class="tr ${newSchemaLevel <= this.schemaExpandLevel ? '' : 'collapsed'} ${data['::type']}" data-obj="${keyLabel}"> <div class="td no-select key ${data['::deprecated'] ? 'deprecated' : ''}" style="padding-left:${leftPadding}px;cursor:pointer" @click="${e => this.toggleObjectExpand(e, keyLabel)}"> <div style="display:flex;align-items:center"> ${keyLabel || keyDescr ? html`<div class="obj-toggle" data-obj="${keyLabel}">▾</div>` : ''} ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION') ? 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('*') ? html`<span class="key-label requiredStar" style="display:inline-block;margin-left:-6px" title="Required"> ${keyLabel.substring(0, keyLabel.length - 1)}</span>` : html`<span class="key-label" style="display:inline-block;margin-left:-6px">${keyLabel === '::props' ? '' : keyLabel}</span>`} </div> </div> <div class="td key-type"> ${displaySchemaLink ? html`<div class="schema-link" style="overflow:hidden;text-overflow:ellipsis" @click="${() => this.scrollToSchemaComponentByName(displaySchemaLink)}">${detailObjType}</div>` : html`<div>${(data['::type'] || '').includes('xxx-of') ? '' : detailObjType}</div>`} <div class="attributes" title="${flags['🆁'] && 'Read only attribute' || flags['🆆'] && 'Write only attribute' || ''}">${flags['🆁'] || flags['🆆'] || ''}</div> </div> <div class="td key-descr"> <span class="m-markdown-small">${unsafeHTML(marked(displayLine))}</span> ${(_data$Metadata = data['::metadata']) !== null && _data$Metadata !== void 0 && (_data$Metadata$constr = _data$Metadata.constraints) !== null && _data$Metadata$constr !== void 0 && _data$Metadata$constr.length ? html`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${data['::metadata'].constraints.join(', ')}</div><br>` : ''} </div> </div>` : html` ${data['::type'] === 'array' && dataType === 'array' ? html`<div class="tr"> <div class="td"> ${dataType} </div> </div>` : ''} `} <div class="object-body"> ${Array.isArray(data) && data[0] ? html`${this.generateTree(data[0], 'xxx-of-option', '::ARRAY~OF', data[0]['::title'], data[0]['::description'], newSchemaLevel, newIndentLevel)}` : html` ${Object.keys(data).map(dataKey => {
124
+ return html` ${newSchemaLevel >= 0 && key ? html` <div class="tr ${newSchemaLevel <= this.schemaExpandLevel ? '' : 'collapsed'} ${data['::type']}" data-obj="${keyLabel}"> <div class="td no-select key ${data['::deprecated'] ? 'deprecated' : ''}" style="padding-left:${leftPadding}px;cursor:pointer" @click="${e => this.toggleObjectExpand(e, keyLabel)}"> <div style="display:flex;align-items:center"> ${keyLabel || keyDescr ? html`<div class="obj-toggle" data-obj="${keyLabel}">▾</div>` : ''} ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION') ? 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('*') ? html`<span class="key-label requiredStar" style="display:inline-block;margin-left:-6px" title="Required"> ${keyLabel.substring(0, keyLabel.length - 1)}</span>` : html`<span class="key-label" style="display:inline-block;margin-left:-6px">${keyLabel === '::props' ? '' : keyLabel}</span>`} </div> </div> <div class="td key-type"> ${displaySchemaLink ? html`<div class="schema-link" style="overflow:hidden;text-overflow:ellipsis" @click="${() => this.scrollToSchemaComponentByName(displaySchemaLink)}"> ${dataType === 'array' ? '[' : ''}<span style="color:var(--primary)">${detailObjType}</span>${dataType === 'array' ? ']' : ''} </div>` : html`<div>${(data['::type'] || '').includes('xxx-of') ? '' : detailObjType}</div>`} <div class="attributes" title="${flags['🆁'] && 'Read only attribute' || flags['🆆'] && 'Write only attribute' || ''}">${flags['🆁'] || flags['🆆'] || ''}</div> </div> <div class="td key-descr"> <span class="m-markdown-small">${unsafeHTML(marked(displayLine))}</span> ${(_data$Metadata = data['::metadata']) !== null && _data$Metadata !== void 0 && (_data$Metadata$constr = _data$Metadata.constraints) !== null && _data$Metadata$constr !== void 0 && _data$Metadata$constr.length ? html`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${data['::metadata'].constraints.join(', ')}</div><br>` : ''} </div> </div>` : html` ${data['::type'] === 'array' && dataType === 'array' ? html`<div class="tr"> <div class="td"> ${dataType} </div> </div>` : ''} `} <div class="object-body"> ${Array.isArray(data) && data[0] ? html`${this.generateTree(data[0], 'xxx-of-option', '::ARRAY~OF', data[0]['::title'], data[0]['::description'], newSchemaLevel, newIndentLevel)}` : html` ${Object.keys(data).map(dataKey => {
125
125
  var _data$dataKey;
126
126
  return !['::metadata', '::title', '::description', '::type', '::link', '::props', '::deprecated', '::array-type', '::dataTypeLabel', '::flags'].includes(dataKey) || (_data$dataKey = data[dataKey]) !== null && _data$dataKey !== void 0 && _data$dataKey['::type'] && !data[dataKey]['::type'].includes('xxx-of') ? html`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], dataKey, data[dataKey]['::title'], data[dataKey]['::description'], newSchemaLevel, newIndentLevel)}` : '';
127
127
  })}`} <div> </div></div>`;
@@ -411,7 +411,7 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
411
411
  if (Object.keys(objWithAnyOfProps).length) {
412
412
  resultObj[anyOf ? `::ANY~OF ${suffix}` : `::ONE~OF ${suffix}`] = objWithAnyOfProps;
413
413
  }
414
- resultObj['::link'] = schema.title;
414
+ resultObj['::link'] = schema.title || '';
415
415
  resultObj['::type'] = schema.title || 'object';
416
416
  resultObj['::flags'] = {
417
417
  '🆁': readOnly && '🆁',
@@ -454,7 +454,7 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
454
454
  }
455
455
  }
456
456
  if (complexTypes.length > 0) {
457
- obj['::link'] = schema.title;
457
+ obj['::link'] = schema.title || '';
458
458
  obj['::type'] = 'object';
459
459
  const multiTypeOptions = {
460
460
  '::type': 'xxx-of-option'
@@ -477,7 +477,7 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
477
477
  '🆁': schema.readOnly && '🆁',
478
478
  '🆆': schema.writeOnly && '🆆'
479
479
  },
480
- '::link': schema.title,
480
+ '::link': schema.title || '',
481
481
  '::type': schema.title || 'object',
482
482
  '::deprecated': schema.deprecated || false,
483
483
  '::metadata': metadata
@@ -499,7 +499,7 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
499
499
  '🆁': schema.readOnly && '🆁',
500
500
  '🆆': schema.writeOnly && '🆆'
501
501
  },
502
- '::link': arrayItemsSchema.title || schema.title,
502
+ '::link': arrayItemsSchema.title || schema.title || '',
503
503
  '::type': 'array',
504
504
  // Array properties are read from the ::props object instead of reading from the keys of this object
505
505
  // '::props': schemaInObjectNotation(Object.assign({ deprecated: schema.deprecated, readOnly: schema.readOnly, writeOnly: schema.writeOnly }, arrayItemsSchema), options, (level + 1)),
@@ -523,7 +523,7 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
523
523
  '🆁': schema.readOnly && '🆁',
524
524
  '🆆': schema.writeOnly && '🆆'
525
525
  };
526
- obj['::link'] = schema.title;
526
+ obj['::link'] = schema.title || '';
527
527
  obj['::type'] = schema.title || 'object';
528
528
  obj['::deprecated'] = schema.deprecated || false;
529
529
  obj['::metadata'] = metadata;
@@ -553,7 +553,7 @@ export function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '
553
553
  '🆁': schema.readOnly && '🆁',
554
554
  '🆆': schema.writeOnly && '🆆'
555
555
  };
556
- obj['::link'] = arrayItemsSchema.title || schema.title;
556
+ obj['::link'] = arrayItemsSchema.title || schema.title || '';
557
557
  obj['::type'] = 'array';
558
558
  obj['::deprecated'] = schema.deprecated || false;
559
559
  obj['::metadata'] = metadata;
@@ -111,7 +111,7 @@ class SchemaTable extends _lit.LitElement {
111
111
  } else if (data['::type']) {
112
112
  displaySchemaLink = data['::link'];
113
113
  if (dataType === 'array') {
114
- detailObjType = `[${data['::link']}]`; // Array of Object
114
+ detailObjType = data['::link'] || keyLabel.replace(/(s|Collection|List)[*]?$/i, ''); // Array of Object
115
115
  } else {
116
116
  detailObjType = data['::link'] || data['::type'];
117
117
  }
@@ -126,7 +126,7 @@ class SchemaTable extends _lit.LitElement {
126
126
  return undefined;
127
127
  }
128
128
  const displayLine = [title && `**${title}${description ? ':' : ''}**`, description].filter(v => v).join(' ');
129
- return (0, _lit.html)` ${newSchemaLevel >= 0 && key ? (0, _lit.html)` <div class="tr ${newSchemaLevel <= this.schemaExpandLevel ? '' : 'collapsed'} ${data['::type']}" data-obj="${keyLabel}"> <div class="td no-select key ${data['::deprecated'] ? 'deprecated' : ''}" style="padding-left:${leftPadding}px;cursor:pointer" @click="${e => this.toggleObjectExpand(e, keyLabel)}"> <div style="display:flex;align-items:center"> ${keyLabel || keyDescr ? (0, _lit.html)`<div class="obj-toggle" data-obj="${keyLabel}">▾</div>` : ''} ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION') ? (0, _lit.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, _lit.html)`<span class="key-label requiredStar" style="display:inline-block;margin-left:-6px" title="Required"> ${keyLabel.substring(0, keyLabel.length - 1)}</span>` : (0, _lit.html)`<span class="key-label" style="display:inline-block;margin-left:-6px">${keyLabel === '::props' ? '' : keyLabel}</span>`} </div> </div> <div class="td key-type"> ${displaySchemaLink ? (0, _lit.html)`<div class="schema-link" style="overflow:hidden;text-overflow:ellipsis" @click="${() => this.scrollToSchemaComponentByName(displaySchemaLink)}">${detailObjType}</div>` : (0, _lit.html)`<div>${(data['::type'] || '').includes('xxx-of') ? '' : detailObjType}</div>`} <div class="attributes" title="${flags['🆁'] && 'Read only attribute' || flags['🆆'] && 'Write only attribute' || ''}">${flags['🆁'] || flags['🆆'] || ''}</div> </div> <div class="td key-descr"> <span class="m-markdown-small">${(0, _unsafeHtml.unsafeHTML)((0, _marked.marked)(displayLine))}</span> ${(_data$Metadata = data['::metadata']) !== null && _data$Metadata !== void 0 && (_data$Metadata$constr = _data$Metadata.constraints) !== null && _data$Metadata$constr !== void 0 && _data$Metadata$constr.length ? (0, _lit.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${data['::metadata'].constraints.join(', ')}</div><br>` : ''} </div> </div>` : (0, _lit.html)` ${data['::type'] === 'array' && dataType === 'array' ? (0, _lit.html)`<div class="tr"> <div class="td"> ${dataType} </div> </div>` : ''} `} <div class="object-body"> ${Array.isArray(data) && data[0] ? (0, _lit.html)`${this.generateTree(data[0], 'xxx-of-option', '::ARRAY~OF', data[0]['::title'], data[0]['::description'], newSchemaLevel, newIndentLevel)}` : (0, _lit.html)` ${Object.keys(data).map(dataKey => {
129
+ return (0, _lit.html)` ${newSchemaLevel >= 0 && key ? (0, _lit.html)` <div class="tr ${newSchemaLevel <= this.schemaExpandLevel ? '' : 'collapsed'} ${data['::type']}" data-obj="${keyLabel}"> <div class="td no-select key ${data['::deprecated'] ? 'deprecated' : ''}" style="padding-left:${leftPadding}px;cursor:pointer" @click="${e => this.toggleObjectExpand(e, keyLabel)}"> <div style="display:flex;align-items:center"> ${keyLabel || keyDescr ? (0, _lit.html)`<div class="obj-toggle" data-obj="${keyLabel}">▾</div>` : ''} ${data['::type'] === 'xxx-of-option' || data['::type'] === 'xxx-of-array' || key.startsWith('::OPTION') ? (0, _lit.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, _lit.html)`<span class="key-label requiredStar" style="display:inline-block;margin-left:-6px" title="Required"> ${keyLabel.substring(0, keyLabel.length - 1)}</span>` : (0, _lit.html)`<span class="key-label" style="display:inline-block;margin-left:-6px">${keyLabel === '::props' ? '' : keyLabel}</span>`} </div> </div> <div class="td key-type"> ${displaySchemaLink ? (0, _lit.html)`<div class="schema-link" style="overflow:hidden;text-overflow:ellipsis" @click="${() => this.scrollToSchemaComponentByName(displaySchemaLink)}"> ${dataType === 'array' ? '[' : ''}<span style="color:var(--primary)">${detailObjType}</span>${dataType === 'array' ? ']' : ''} </div>` : (0, _lit.html)`<div>${(data['::type'] || '').includes('xxx-of') ? '' : detailObjType}</div>`} <div class="attributes" title="${flags['🆁'] && 'Read only attribute' || flags['🆆'] && 'Write only attribute' || ''}">${flags['🆁'] || flags['🆆'] || ''}</div> </div> <div class="td key-descr"> <span class="m-markdown-small">${(0, _unsafeHtml.unsafeHTML)((0, _marked.marked)(displayLine))}</span> ${(_data$Metadata = data['::metadata']) !== null && _data$Metadata !== void 0 && (_data$Metadata$constr = _data$Metadata.constraints) !== null && _data$Metadata$constr !== void 0 && _data$Metadata$constr.length ? (0, _lit.html)`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${data['::metadata'].constraints.join(', ')}</div><br>` : ''} </div> </div>` : (0, _lit.html)` ${data['::type'] === 'array' && dataType === 'array' ? (0, _lit.html)`<div class="tr"> <div class="td"> ${dataType} </div> </div>` : ''} `} <div class="object-body"> ${Array.isArray(data) && data[0] ? (0, _lit.html)`${this.generateTree(data[0], 'xxx-of-option', '::ARRAY~OF', data[0]['::title'], data[0]['::description'], newSchemaLevel, newIndentLevel)}` : (0, _lit.html)` ${Object.keys(data).map(dataKey => {
130
130
  var _data$dataKey;
131
131
  return !['::metadata', '::title', '::description', '::type', '::link', '::props', '::deprecated', '::array-type', '::dataTypeLabel', '::flags'].includes(dataKey) || (_data$dataKey = data[dataKey]) !== null && _data$dataKey !== void 0 && _data$dataKey['::type'] && !data[dataKey]['::type'].includes('xxx-of') ? (0, _lit.html)`${this.generateTree(data[dataKey]['::type'] === 'array' ? data[dataKey]['::props'] : data[dataKey], data[dataKey]['::type'], dataKey, data[dataKey]['::title'], data[dataKey]['::description'], newSchemaLevel, newIndentLevel)}` : '';
132
132
  })}`} <div> </div></div>`;
@@ -420,7 +420,7 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
420
420
  if (Object.keys(objWithAnyOfProps).length) {
421
421
  resultObj[anyOf ? `::ANY~OF ${suffix}` : `::ONE~OF ${suffix}`] = objWithAnyOfProps;
422
422
  }
423
- resultObj['::link'] = schema.title;
423
+ resultObj['::link'] = schema.title || '';
424
424
  resultObj['::type'] = schema.title || 'object';
425
425
  resultObj['::flags'] = {
426
426
  '🆁': readOnly && '🆁',
@@ -463,7 +463,7 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
463
463
  }
464
464
  }
465
465
  if (complexTypes.length > 0) {
466
- obj['::link'] = schema.title;
466
+ obj['::link'] = schema.title || '';
467
467
  obj['::type'] = 'object';
468
468
  const multiTypeOptions = {
469
469
  '::type': 'xxx-of-option'
@@ -486,7 +486,7 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
486
486
  '🆁': schema.readOnly && '🆁',
487
487
  '🆆': schema.writeOnly && '🆆'
488
488
  },
489
- '::link': schema.title,
489
+ '::link': schema.title || '',
490
490
  '::type': schema.title || 'object',
491
491
  '::deprecated': schema.deprecated || false,
492
492
  '::metadata': metadata
@@ -508,7 +508,7 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
508
508
  '🆁': schema.readOnly && '🆁',
509
509
  '🆆': schema.writeOnly && '🆆'
510
510
  },
511
- '::link': arrayItemsSchema.title || schema.title,
511
+ '::link': arrayItemsSchema.title || schema.title || '',
512
512
  '::type': 'array',
513
513
  // Array properties are read from the ::props object instead of reading from the keys of this object
514
514
  // '::props': schemaInObjectNotation(Object.assign({ deprecated: schema.deprecated, readOnly: schema.readOnly, writeOnly: schema.writeOnly }, arrayItemsSchema), options, (level + 1)),
@@ -532,7 +532,7 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
532
532
  '🆁': schema.readOnly && '🆁',
533
533
  '🆆': schema.writeOnly && '🆆'
534
534
  };
535
- obj['::link'] = schema.title;
535
+ obj['::link'] = schema.title || '';
536
536
  obj['::type'] = schema.title || 'object';
537
537
  obj['::deprecated'] = schema.deprecated || false;
538
538
  obj['::metadata'] = metadata;
@@ -562,7 +562,7 @@ function schemaInObjectNotation(rawSchema, options, level = 0, suffix = '') {
562
562
  '🆁': schema.readOnly && '🆁',
563
563
  '🆆': schema.writeOnly && '🆆'
564
564
  };
565
- obj['::link'] = arrayItemsSchema.title || schema.title;
565
+ obj['::link'] = arrayItemsSchema.title || schema.title || '';
566
566
  obj['::type'] = 'array';
567
567
  obj['::deprecated'] = schema.deprecated || false;
568
568
  obj['::metadata'] = metadata;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-explorer",
3
- "version": "2.1.658",
3
+ "version": "2.1.659",
4
4
  "description": "OpenAPI Explorer - API viewer with dynamically generated components, documentation, and interaction console",
5
5
  "author": "Authress Developers <developers@authress.io>",
6
6
  "type": "module",