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

Method loadSpec

src/rapidoc-mini.js:286–322  ·  view source on GitHub ↗
(specUrl)

Source from the content-addressed store, hash-verified

284
285 // Public Method
286 async loadSpec(specUrl) {
287 if (!specUrl) {
288 return;
289 }
290 try {
291 this.resolvedSpec = {
292 specLoadError: false,
293 isSpecLoading: true,
294 tags: [],
295 };
296 this.loading = true;
297 this.loadFailed = false;
298 this.requestUpdate();
299 const spec = await ProcessSpec.call(
300 this,
301 specUrl,
302 this.generateMissingTags === 'true',
303 this.sortTags === 'true',
304 this.sortSchemas === 'true',
305 this.getAttribute('sort-endpoints-by'),
306 this.getAttribute('api-key-name'),
307 this.getAttribute('api-key-location'),
308 this.getAttribute('api-key-value'),
309 this.getAttribute('server-url'),
310 this.matchPaths,
311 this.matchType,
312 this.removeEndpointsWithBadgeLabelAs,
313 );
314 this.loading = false;
315 this.afterSpecParsedAndValidated(spec);
316 } catch (err) {
317 this.loading = false;
318 this.loadFailed = true;
319 this.resolvedSpec = null;
320 console.error(`RapiDoc: Unable to resolve the API spec.. ${err.message}`); // eslint-disable-line no-console
321 }
322 }
323
324 // Public Method - to update security-scheme of type http
325 setHttpUserNameAndPassword(securitySchemeId, username, password) {

Callers 1

Calls 2

requestUpdateMethod · 0.45

Tested by

no test coverage detected