openapi-explorer 2.1.661 → 2.1.663
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/dist/browser/openapi-explorer.min.js +2 -2
- package/dist/es/openapi-explorer.js +2 -2
- package/dist/es/templates/mainBodyTemplate.js +1 -1
- package/dist/es/utils/spec-parser.js +2 -1
- package/dist/lib/openapi-explorer.js +2 -2
- package/dist/lib/templates/mainBodyTemplate.js +1 -1
- package/dist/lib/utils/spec-parser.js +3 -1
- package/package.json +2 -2
@@ -400,7 +400,7 @@ export default class OpenApiExplorer extends LitElement {
|
|
400
400
|
var _spec$info;
|
401
401
|
this.resolvedSpec = null;
|
402
402
|
this.loading = true;
|
403
|
-
this.
|
403
|
+
this.loadingFailedError = null;
|
404
404
|
const spec = await ProcessSpec(specUrlOrObject, this.serverUrl);
|
405
405
|
this.loading = false;
|
406
406
|
if (spec === undefined || spec === null) {
|
@@ -416,7 +416,7 @@ export default class OpenApiExplorer extends LitElement {
|
|
416
416
|
this.afterSpecParsedAndValidated(spec);
|
417
417
|
} catch (err) {
|
418
418
|
this.loading = false;
|
419
|
-
this.
|
419
|
+
this.loadingFailedError = err.message;
|
420
420
|
this.resolvedSpec = null;
|
421
421
|
console.error('OpenAPI Explorer: Unable to resolve the API spec..', err); // eslint-disable-line no-console
|
422
422
|
}
|
@@ -25,7 +25,7 @@ export default function mainBodyTemplate() {
|
|
25
25
|
};
|
26
26
|
|
27
27
|
/* eslint-disable indent */
|
28
|
-
return html` ${SetTheme.call(this, newTheme)} ${this.hideSearch ? '' : advancedSearchTemplate.call(this)} <div id="the-main-body" class="body"> ${this.renderStyle === 'focused' && this.resolvedSpec ? navbarTemplate.call(this) : ''} ${this.loading === true ? html`<slot name="loader"><div class="loader"></div></slot>` : html` <main class="main-content regular-font" part="section-main-content"> <div id="operations-root" class="main-content-inner"> ${this.
|
28
|
+
return html` ${SetTheme.call(this, newTheme)} ${this.hideSearch ? '' : advancedSearchTemplate.call(this)} <div id="the-main-body" class="body"> ${this.renderStyle === 'focused' && this.resolvedSpec ? navbarTemplate.call(this) : ''} ${this.loading === true ? html`<slot name="loader"><div class="loader"></div></slot>` : html` <main class="main-content regular-font" part="section-main-content"> <div id="operations-root" class="main-content-inner"> ${this.loadingFailedError ? html` <div style="text-align:center;margin:16px"> Unable to load the Spec${this.specUrl ? ': ' : ''} <strong>${this.specUrl}</strong> <br><br> <div> ${this.loadingFailedError} </div> </div>` : html` <div class="operations-root" @click="${e => {
|
29
29
|
this.handleHref(e);
|
30
30
|
}}"> ${this.renderStyle === 'focused' ? html`${focusedEndpointTemplate.call(this)}` : html` ${!this.hideInfo ? overviewTemplate.call(this) : ''} ${!this.hideServerSelection ? serverTemplate.call(this) : ''} ${!this.hideAuthentication ? securitySchemeTemplate.call(this) : ''} <section id="section" class="observe-me ${this.renderStyle === 'focused' ? 'section-gap--focused-mode' : 'section-gap'}"> <slot name="custom-section"></slot> </section> ${endpointTemplate.call(this)}`} </div>`} </div> </main>`} </div> `;
|
31
31
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
// To inline test changes to the OpenAPiResolver, it must be copied into the node_modules directory. The builder for this package will not work across repositories.
|
1
2
|
import OpenApiResolver from 'openapi-resolver/dist/openapi-resolver.browser.js';
|
2
3
|
import { marked } from 'marked';
|
3
4
|
import { invalidCharsRegEx } from './common-utils.js';
|
@@ -11,7 +12,7 @@ export default async function ProcessSpec(specUrlOrObject, serverUrl = '') {
|
|
11
12
|
} catch (error) {
|
12
13
|
// eslint-disable-next-line no-console
|
13
14
|
console.error('Error parsing specification', error);
|
14
|
-
throw Error(
|
15
|
+
throw Error(`Failed to resolve the spec: ${error.message}`);
|
15
16
|
}
|
16
17
|
if (!jsonParsedSpec) {
|
17
18
|
throw Error('SpecificationNotFound');
|
@@ -406,7 +406,7 @@ class OpenApiExplorer extends _lit.LitElement {
|
|
406
406
|
var _spec$info;
|
407
407
|
this.resolvedSpec = null;
|
408
408
|
this.loading = true;
|
409
|
-
this.
|
409
|
+
this.loadingFailedError = null;
|
410
410
|
const spec = await (0, _specParser.default)(specUrlOrObject, this.serverUrl);
|
411
411
|
this.loading = false;
|
412
412
|
if (spec === undefined || spec === null) {
|
@@ -422,7 +422,7 @@ class OpenApiExplorer extends _lit.LitElement {
|
|
422
422
|
this.afterSpecParsedAndValidated(spec);
|
423
423
|
} catch (err) {
|
424
424
|
this.loading = false;
|
425
|
-
this.
|
425
|
+
this.loadingFailedError = err.message;
|
426
426
|
this.resolvedSpec = null;
|
427
427
|
console.error('OpenAPI Explorer: Unable to resolve the API spec..', err); // eslint-disable-line no-console
|
428
428
|
}
|
@@ -30,7 +30,7 @@ function mainBodyTemplate() {
|
|
30
30
|
};
|
31
31
|
|
32
32
|
/* eslint-disable indent */
|
33
|
-
return (0, _lit.html)` ${_theme.default.call(this, newTheme)} ${this.hideSearch ? '' : _advanceSearchTemplate.default.call(this)} <div id="the-main-body" class="body"> ${this.renderStyle === 'focused' && this.resolvedSpec ? _navbarTemplate.default.call(this) : ''} ${this.loading === true ? (0, _lit.html)`<slot name="loader"><div class="loader"></div></slot>` : (0, _lit.html)` <main class="main-content regular-font" part="section-main-content"> <div id="operations-root" class="main-content-inner"> ${this.
|
33
|
+
return (0, _lit.html)` ${_theme.default.call(this, newTheme)} ${this.hideSearch ? '' : _advanceSearchTemplate.default.call(this)} <div id="the-main-body" class="body"> ${this.renderStyle === 'focused' && this.resolvedSpec ? _navbarTemplate.default.call(this) : ''} ${this.loading === true ? (0, _lit.html)`<slot name="loader"><div class="loader"></div></slot>` : (0, _lit.html)` <main class="main-content regular-font" part="section-main-content"> <div id="operations-root" class="main-content-inner"> ${this.loadingFailedError ? (0, _lit.html)` <div style="text-align:center;margin:16px"> Unable to load the Spec${this.specUrl ? ': ' : ''} <strong>${this.specUrl}</strong> <br><br> <div> ${this.loadingFailedError} </div> </div>` : (0, _lit.html)` <div class="operations-root" @click="${e => {
|
34
34
|
this.handleHref(e);
|
35
35
|
}}"> ${this.renderStyle === 'focused' ? (0, _lit.html)`${_focusedEndpointTemplate.default.call(this)}` : (0, _lit.html)` ${!this.hideInfo ? _overviewTemplate.default.call(this) : ''} ${!this.hideServerSelection ? _serverTemplate.default.call(this) : ''} ${!this.hideAuthentication ? _securitySchemeTemplate.default.call(this) : ''} <section id="section" class="observe-me ${this.renderStyle === 'focused' ? 'section-gap--focused-mode' : 'section-gap'}"> <slot name="custom-section"></slot> </section> ${_endpointTemplate.default.call(this)}`} </div>`} </div> </main>`} </div> `;
|
36
36
|
}
|
@@ -7,6 +7,8 @@ var _marked = require("marked");
|
|
7
7
|
var _commonUtils = require("./common-utils.js");
|
8
8
|
var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
|
+
// To inline test changes to the OpenAPiResolver, it must be copied into the node_modules directory. The builder for this package will not work across repositories.
|
11
|
+
|
10
12
|
async function ProcessSpec(specUrlOrObject, serverUrl = '') {
|
11
13
|
var _jsonParsedSpec$info, _jsonParsedSpec$compo;
|
12
14
|
const inputSpecIsAUrl = typeof specUrlOrObject === 'string' && specUrlOrObject.match(/^http/) || typeof specUrlOrObject === 'object' && typeof specUrlOrObject.href === 'string';
|
@@ -16,7 +18,7 @@ async function ProcessSpec(specUrlOrObject, serverUrl = '') {
|
|
16
18
|
} catch (error) {
|
17
19
|
// eslint-disable-next-line no-console
|
18
20
|
console.error('Error parsing specification', error);
|
19
|
-
throw Error(
|
21
|
+
throw Error(`Failed to resolve the spec: ${error.message}`);
|
20
22
|
}
|
21
23
|
if (!jsonParsedSpec) {
|
22
24
|
throw Error('SpecificationNotFound');
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "openapi-explorer",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.663",
|
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",
|
@@ -62,7 +62,7 @@
|
|
62
62
|
"lodash.merge": "^4.6.2",
|
63
63
|
"marked": "^4.0.16",
|
64
64
|
"openapi-data-validator": "^2.0.40",
|
65
|
-
"openapi-resolver": "^4.1.
|
65
|
+
"openapi-resolver": "^4.1.53",
|
66
66
|
"prismjs": "^1.29.0",
|
67
67
|
"randexp": "^0.5.3",
|
68
68
|
"xml-but-prettier": "^1.0.1"
|