24 lines
752 B
JavaScript
24 lines
752 B
JavaScript
(function () {
|
|
'use strict';
|
|
window.apiDocs = SwaggerUIBundle({
|
|
url: '/openapi.json',
|
|
dom_id: '#swagger-ui',
|
|
deepLinking: true,
|
|
displayRequestDuration: true,
|
|
docExpansion: 'list',
|
|
filter: true,
|
|
defaultModelsExpandDepth: 0,
|
|
persistAuthorization: false,
|
|
validatorUrl: null,
|
|
queryConfigEnabled: false,
|
|
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
|
|
requestInterceptor: function (request) {
|
|
if (new URL(request.url, location.href).origin !== location.origin) {
|
|
throw new Error('API documentation can send requests only to this instance.');
|
|
}
|
|
return request;
|
|
}
|
|
});
|
|
window.apiDocs.initOAuth({ clientId: 'swagger-ui', appName: 'MikroTik Backup System' });
|
|
}());
|