Skip to content

Commit 1a15974

Browse files
authored
Merge branch 'master' into travis-performance
2 parents a021905 + 9994996 commit 1a15974

38 files changed

+606
-308
lines changed

.github/issue_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!---
22
Thanks for filing an issue 😄 ! Before you submit, please read the following:
33
4+
If you're here to report a security issue, please STOP writing an issue and contact us
5+
at [email protected] instead!
6+
47
Search open/closed issues before submitting since someone might have asked the same thing before!
58
69
Issues on GitHub are only related to problems of Swagger-UI itself. We'll try to offer support

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The OpenAPI Specification has undergone 5 revisions since initial creation in 20
2222

2323
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes
2424
------------------ | ------------ | -------------------------- | -----
25-
3.4.1 | 2017-10-20 | 2.0, 3.0 | [tag v3.4.1](https://github.com/swagger-api/swagger-ui/tree/v3.4.1)
25+
3.4.2 | 2017-10-30 | 2.0, 3.0 | [tag v3.4.2](https://github.com/swagger-api/swagger-ui/tree/v3.4.2)
2626
3.0.21 | 2017-07-26 | 2.0 | [tag v3.0.21](https://github.com/swagger-api/swagger-ui/tree/v3.0.21)
2727
2.2.10 | 2017-01-04 | 1.1, 1.2, 2.0 | [tag v2.2.10](https://github.com/swagger-api/swagger-ui/tree/v2.2.10)
2828
2.1.5 | 2016-07-20 | 1.1, 1.2, 2.0 | [tag v2.1.5](https://github.com/swagger-api/swagger-ui/tree/v2.1.5)

dist/swagger-ui-bundle.js

Lines changed: 59 additions & 33 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: 2 additions & 2 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.

docs/version-detection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Some distinct identifiers to Swagger-UI 3.X:
2020

2121
If you've determined this is the version you have, to find the exact version:
2222
- Open your browser's web console (changes between browsers)
23-
- Type `versions` in the console and execute the call.
24-
- You might need to expand the result, until you get a string similar to `swaggerUi : Object { version: "3.1.6", gitRevision: "g786cd47", gitDirty: true, … }`.
23+
- Type `JSON.stringify(versions)` in the console and execute the call.
24+
- The result should look similar to `swaggerUi : Object { version: "3.1.6", gitRevision: "g786cd47", gitDirty: true, … }`.
2525
- The version taken from that example would be `3.1.6`.
2626

2727
Note: This functionality was added in 3.0.8. If you're unable to execute it, you're likely to use an older version, and in that case the first step would be to upgrade.
@@ -51,4 +51,4 @@ If you've determined this is the version you have, to find the exact version:
5151
* @link http://swagger.io
5252
* @license Apache-2.0
5353
*/
54-
```
54+
```

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swagger-ui",
3-
"version": "3.4.1",
3+
"version": "3.4.2",
44
"main": "dist/swagger-ui.js",
55
"repository": "[email protected]:swagger-api/swagger-ui.git",
66
"contributors": [
@@ -39,6 +39,7 @@
3939
"e2e": "npm-run-all --parallel -r hot-server mock-api test-e2e"
4040
},
4141
"dependencies": {
42+
"@braintree/sanitize-url": "^2.0.2",
4243
"base64-js": "^1.2.0",
4344
"brace": "0.7.0",
4445
"classnames": "^2.2.5",
@@ -55,12 +56,12 @@
5556
"memoizee": "0.4.1",
5657
"promise-worker": "^1.1.1",
5758
"prop-types": "^15.5.10",
58-
"react": "^15.4.0",
59+
"react": "^15.6.2",
5960
"react-addons-perf": "^15.4.0",
6061
"react-addons-shallow-compare": "0.14.8",
61-
"react-addons-test-utils": "^15.4.0",
62+
"react-addons-test-utils": "^15.6.2",
6263
"react-collapse": "2.3.1",
63-
"react-dom": "^15.4.0",
64+
"react-dom": "^15.6.2",
6465
"react-height": "^2.0.0",
6566
"react-hot-loader": "1.3.1",
6667
"react-immutable-proptypes": "2.1.0",
@@ -83,6 +84,7 @@
8384
"whatwg-fetch": "0.11.1",
8485
"worker-loader": "^0.7.1",
8586
"xml": "1.0.1",
87+
"xml-but-prettier": "^1.0.1",
8688
"yaml-js": "0.2.0"
8789
},
8890
"devDependencies": {

src/core/components/array-model.jsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,23 @@ export default class ArrayModel extends Component {
2424
const Markdown = getComponent("Markdown")
2525
const ModelCollapse = getComponent("ModelCollapse")
2626
const Model = getComponent("Model")
27+
const Property = getComponent("Property")
2728

2829
const titleEl = title &&
2930
<span className="model-title">
3031
<span className="model-title__text">{ title }</span>
3132
</span>
3233

33-
/*
34+
/*
3435
Note: we set `name={null}` in <Model> below because we don't want
3536
the name of the current Model passed (and displayed) as the name of the array element Model
36-
*/
37+
*/
3738

3839
return <span className="model">
3940
<ModelCollapse title={titleEl} collapsed={ depth > expandDepth } collapsedContent="[...]">
4041
[
4142
{
42-
properties.size ? properties.entrySeq().map( ( [ key, v ] ) => <span key={`${key}-${v}`} style={ propStyle }>
43-
<br />{ key }: { String(v) }</span>)
44-
: null
43+
properties.size ? properties.entrySeq().map( ( [ key, v ] ) => <Property key={`${key}-${v}`} propKey={ key } propVal={ v } propStyle={ propStyle } />) : null
4544
}
4645
{
4746
!description ? null :

src/core/components/info.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from "react"
22
import PropTypes from "prop-types"
33
import { fromJS } from "immutable"
44
import ImPropTypes from "react-immutable-proptypes"
5+
import { sanitizeUrl } from "core/utils"
56

67

78
class Path extends React.Component {
@@ -35,9 +36,9 @@ class Contact extends React.Component {
3536

3637
return (
3738
<div>
38-
{ url && <div><a href={ url } target="_blank">{ name } - Website</a></div> }
39+
{ url && <div><a href={ sanitizeUrl(url) } target="_blank">{ name } - Website</a></div> }
3940
{ email &&
40-
<a href={`mailto:${email}`}>
41+
<a href={sanitizeUrl(`mailto:${email}`)}>
4142
{ url ? `Send email to ${name}` : `Contact ${name}`}
4243
</a>
4344
}
@@ -59,7 +60,7 @@ class License extends React.Component {
5960
return (
6061
<div>
6162
{
62-
url ? <a target="_blank" href={ url }>{ name }</a>
63+
url ? <a target="_blank" href={ sanitizeUrl(url) }>{ name }</a>
6364
: <span>{ name }</span>
6465
}
6566
</div>
@@ -97,7 +98,7 @@ export default class Info extends React.Component {
9798
{ version && <VersionStamp version={version}></VersionStamp> }
9899
</h2>
99100
{ host || basePath ? <Path host={ host } basePath={ basePath } /> : null }
100-
{ url && <a target="_blank" href={ url }><span className="url"> { url } </span></a> }
101+
{ url && <a target="_blank" href={ sanitizeUrl(url) }><span className="url"> { url } </span></a> }
101102
</hgroup>
102103

103104
<div className="description">
@@ -106,14 +107,14 @@ export default class Info extends React.Component {
106107

107108
{
108109
termsOfService && <div>
109-
<a target="_blank" href={ termsOfService }>Terms of service</a>
110+
<a target="_blank" href={ sanitizeUrl(termsOfService) }>Terms of service</a>
110111
</div>
111112
}
112113

113114
{ contact && contact.size ? <Contact data={ contact } /> : null }
114115
{ license && license.size ? <License license={ license } /> : null }
115116
{ externalDocsUrl ?
116-
<a target="_blank" href={externalDocsUrl}>{externalDocsDescription || externalDocsUrl}</a>
117+
<a target="_blank" href={sanitizeUrl(externalDocsUrl)}>{externalDocsDescription || externalDocsUrl}</a>
117118
: null }
118119

119120
</div>

0 commit comments

Comments
 (0)