Skip to content

Commit 94c86d3

Browse files
authored
improvement: online.swagger.io -> validator.swagger.io (#5599)
1 parent 7cae0d2 commit 94c86d3

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

docs/usage/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Parameter name | Docker variable | Description
7070
<a name="responseInterceptor"></a>`responseInterceptor` | _Unavailable_ | `Function=(a => a)`. MUST be a function. Function to intercept remote definition, "Try it out", and OAuth 2.0 responses. Accepts one argument responseInterceptor(response) and must return the modified response, or a Promise that resolves to the modified response.
7171
<a name="showMutatedRequest"></a>`showMutatedRequest` | `SHOW_MUTATED_REQUEST` | `Boolean=true`. If set to `true`, uses the mutated request returned from a requestInterceptor to produce the curl command in the UI, otherwise the request before the requestInterceptor was applied is used.
7272
<a name="supportedSubmitMethods"></a>`supportedSubmitMethods` | `SUPPORTED_SUBMIT_METHODS` | `Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]`. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display.
73-
<a name="validatorUrl"></a>`validatorUrl` | `VALIDATOR_URL` | `String="https://online.swagger.io/validator" OR null`. By default, Swagger UI attempts to validate specs against swagger.io's online validator. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it to `null` will disable validation.
73+
<a name="validatorUrl"></a>`validatorUrl` | `VALIDATOR_URL` | `String="https://validator.swagger.io/validator" OR null`. By default, Swagger UI attempts to validate specs against swagger.io's online validator. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it to `null` will disable validation.
7474
<a name="withCredentials"></a>`withCredentials` | `WITH_CREDENTIALS` | `Boolean=false` If set to `true`, enables passing credentials, [as defined in the Fetch standard](https://fetch.spec.whatwg.org/#credentials), in CORS requests that are sent by the browser. Note that Swagger UI cannot currently set cookies cross-domain (see [swagger-js#1163](https://github.com/swagger-api/swagger-js/issues/1163)) - as a result, you will have to rely on browser-supplied cookies (which this setting enables sending) that Swagger UI cannot control.
7575

7676
##### Macros

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class OnlineValidatorBadge extends React.Component {
1818
let { validatorUrl } = getConfigs()
1919
this.state = {
2020
url: this.getDefinitionUrl(),
21-
validatorUrl: validatorUrl === undefined ? "https://online.swagger.io/validator" : validatorUrl
21+
validatorUrl: validatorUrl === undefined ? "https://validator.swagger.io/validator" : validatorUrl
2222
}
2323
}
2424

@@ -36,7 +36,7 @@ export default class OnlineValidatorBadge extends React.Component {
3636

3737
this.setState({
3838
url: this.getDefinitionUrl(),
39-
validatorUrl: validatorUrl === undefined ? "https://online.swagger.io/validator" : validatorUrl
39+
validatorUrl: validatorUrl === undefined ? "https://validator.swagger.io/validator" : validatorUrl
4040
})
4141
}
4242

src/core/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function SwaggerUI(opts) {
3535
docExpansion: "list",
3636
maxDisplayedTags: null,
3737
filter: null,
38-
validatorUrl: "https://online.swagger.io/validator",
38+
validatorUrl: "https://validator.swagger.io/validator",
3939
oauth2RedirectUrl: `${window.location.protocol}//${window.location.host}/oauth2-redirect.html`,
4040
configs: {},
4141
custom: {},

swagger-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
url: "https://petstore.swagger.io/v2/swagger.json"
33
dom_id: "#swagger-ui"
4-
validatorUrl: "https://online.swagger.io/validator"
4+
validatorUrl: "https://validator.swagger.io/validator"

test/components/online-validator-badge.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ describe("<OnlineValidatorBadge/>", function () {
2121

2222
// Then
2323
expect(wrapper.find("a").props().href).toEqual(
24-
"https://online.swagger.io/validator/debug?url=swagger.json"
24+
"https://validator.swagger.io/validator/debug?url=swagger.json"
2525
)
2626
expect(wrapper.find("ValidatorImage").length).toEqual(1)
2727
expect(wrapper.find("ValidatorImage").props().src).toEqual(
28-
"https://online.swagger.io/validator?url=swagger.json"
28+
"https://validator.swagger.io/validator?url=swagger.json"
2929
)
3030
})
3131
it("should encode a definition URL correctly", function () {
@@ -43,11 +43,11 @@ describe("<OnlineValidatorBadge/>", function () {
4343

4444
// Then
4545
expect(wrapper.find("a").props().href).toEqual(
46-
"https://online.swagger.io/validator/debug?url=http%3A%2F%2Fgoogle.com%2Fswagger.json"
46+
"https://validator.swagger.io/validator/debug?url=http%3A%2F%2Fgoogle.com%2Fswagger.json"
4747
)
4848
expect(wrapper.find("ValidatorImage").length).toEqual(1)
4949
expect(wrapper.find("ValidatorImage").props().src).toEqual(
50-
"https://online.swagger.io/validator?url=http%3A%2F%2Fgoogle.com%2Fswagger.json"
50+
"https://validator.swagger.io/validator?url=http%3A%2F%2Fgoogle.com%2Fswagger.json"
5151
)
5252
})
5353
it.skip("should resolve a definition URL against the browser's location", function () {
@@ -67,11 +67,11 @@ describe("<OnlineValidatorBadge/>", function () {
6767

6868
// Then
6969
expect(wrapper.find("a").props().href).toEqual(
70-
"https://online.swagger.io/validator/debug?url=http%3A%2F%2Fgoogle.com%2Fswagger.json"
70+
"https://validator.swagger.io/validator/debug?url=http%3A%2F%2Fgoogle.com%2Fswagger.json"
7171
)
7272
expect(wrapper.find("ValidatorImage").length).toEqual(1)
7373
expect(wrapper.find("ValidatorImage").props().src).toEqual(
74-
"https://online.swagger.io/validator?url=http%3A%2F%2Fgoogle.com%2Fswagger.json"
74+
"https://validator.swagger.io/validator?url=http%3A%2F%2Fgoogle.com%2Fswagger.json"
7575
)
7676
})
7777
// should resolve a definition URL against the browser's location

test/xss/anchor-target-rel/online-validator-badge.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("<OnlineValidatorBadge/> Anchor Target Safety", function () {
2323

2424
// Then
2525
expect(anchor.props().href).toEqual(
26-
"https://online.swagger.io/validator/debug?url=swagger.json"
26+
"https://validator.swagger.io/validator/debug?url=swagger.json"
2727
)
2828
expect(anchor.props().target).toEqual("_blank")
2929
expect(anchor.props().rel || "").toInclude("noopener")

0 commit comments

Comments
 (0)