Skip to content

Commit ded299d

Browse files
committed
swagger-api#2796 disable validator (with badge) by removing it from config
1 parent 374b361 commit ded299d

File tree

6 files changed

+59
-60
lines changed

6 files changed

+59
-60
lines changed

dist/swagger-ui-bundle.js

Lines changed: 45 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui-bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/swagger-ui.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/components/online-validator-badge.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default class OnlineValidatorBadge extends React.Component {
1313
let { validatorUrl } = getConfigs()
1414
this.state = {
1515
url: specSelectors.url(),
16-
validatorUrl: validatorUrl || "https://online.swagger.io/validator"
16+
validatorUrl: validatorUrl === undefined ? "https://online.swagger.io/validator" : null
1717
}
1818
}
1919

@@ -23,7 +23,7 @@ export default class OnlineValidatorBadge extends React.Component {
2323

2424
this.setState({
2525
url: specSelectors.url(),
26-
validatorUrl: validatorUrl || "https://online.swagger.io/validator"
26+
validatorUrl: validatorUrl === undefined ? "https://online.swagger.io/validator" : null
2727
})
2828
}
2929

@@ -33,7 +33,7 @@ export default class OnlineValidatorBadge extends React.Component {
3333

3434
if ( typeof spec === "object" && Object.keys(spec).length) return null
3535

36-
if (!this.state.url) {
36+
if (!this.state.url || !this.state.validatorUrl) {
3737
return null
3838
}
3939

src/core/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ module.exports = function SwaggerUI(opts) {
1414
spec: {},
1515
url: "",
1616
layout: "Layout",
17+
validatorUrl: "https://online.swagger.io/validator",
1718
configs: {
18-
validatorUrl: "https://online.swagger.io/validator"
1919
},
2020

2121
// Initial set of plugins ( TODO rename this, or refactor - we don't need presets _and_ plugins. Its just there for performance.

0 commit comments

Comments
 (0)