window.onload = function() {
    // Build a system
    const ui = SwaggerUIBundle({
        url: "/swagger/json/swagger-digx.json",
        dom_id: '#swagger-ui',
        deepLinking: true,
        validatorUrl: null,
        highlightSizeThreshold: 1,
        presets: [
            SwaggerUIBundle.presets.apis,
            SwaggerUIStandalonePreset
        ],
        plugins: [
            SwaggerUIBundle.plugins.DownloadUrl
        ],
        layout: "StandaloneLayout",
        requestInterceptor: (req) => {
            req.headers['X-Token-Type'] = 'OAM';
            req.headers['scope'] = 'OBDXMobileAppResServer.OBDXLoginScope';

            return req;
        }
    })
    ui.initOAuth({
        clientId: "2d79e939e042apiaccess8e5fab436fb5581",
        clientSecret: "welcome1",
    })


    window.ui = ui
}
