grocy/js/viewjs/openapiui.js
Katharina Bogad 3d7f0652ce eslint: viewjs
Fixed all reported errors, deduped some code in the picker components.
However, these edits were small enough that I'm positive they work.
2021-06-18 20:55:09 +02:00

28 lines
501 B
JavaScript

/* global SwaggerUIBundle, SwaggerUIStandalonePreset */
function HideTopbarPlugin()
{
return {
components: {
Topbar: function() { return null }
}
}
}
const swaggerUi = SwaggerUIBundle({
url: Grocy.OpenApi.SpecUrl,
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl,
HideTopbarPlugin
],
layout: 'StandaloneLayout',
docExpansion: "list"
});
window.ui = swaggerUi;