Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module.exports = function SwaggerUI(opts) {
maxDisplayedTags: null,
filter: null,
validatorUrl: "https://online.swagger.io/validator",
oauth2RedirectUrl: `${window.location.protocol}//${window.location.host}/oauth2-redirect.html`,
configs: {},
custom: {},
displayOperationId: false,
Expand Down
3 changes: 1 addition & 2 deletions swagger-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
url: "https://petstore.swagger.io/v2/swagger.json"
dom_id: "#swagger-ui"
validatorUrl: "https://online.swagger.io/validator"
oauth2RedirectUrl: "http://localhost:3200/oauth2-redirect.html"
validatorUrl: "https://online.swagger.io/validator"
10 changes: 10 additions & 0 deletions test/e2e-cypress/tests/features/dynamic-default-oauth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
describe("dynamic default oauth2RedirectUrl", () => {
it("should render the OAS3 badge correctly", () => {
// This is a sanity check to make sure the badge is present.
// If this is failing, it's probably not related to #4865.
cy.visit("/")
.window()
.then(win => win.ui.getConfigs())
.should("include", { oauth2RedirectUrl: "http://localhost:3230/oauth2-redirect.html" })
})
})