Merge branch 'master' into master

This commit is contained in:
Franz Wong
2017-06-06 19:45:35 +09:00
committed by GitHub
12 changed files with 54 additions and 46 deletions

View File

@@ -15,7 +15,8 @@ The OpenAPI Specification has undergone 4 revisions since initial creation in 20
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes | Status Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes | Status
------------------ | ------------ | -------------------------- | ----- | ------ ------------------ | ------------ | -------------------------- | ----- | ------
3.0.12 | 2017-03-19 | 2.0 | [tag v3.0.12](https://github.com/swagger-api/swagger-ui/tree/v3.0.12) | 3.0.13 | 2017-06-02 | 2.0 | [tag
v3.0.13](https://github.com/swagger-api/swagger-ui/tree/v3.0.13) |
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) | 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) |
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) | 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) |
2.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/swagger-api/swagger-ui/tree/v2.0.24) | 2.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/swagger-api/swagger-ui/tree/v2.0.24) |
@@ -125,6 +126,7 @@ operationsSorter | Apply a sort to the operation list of each API. It can be 'al
configUrl | Configs URL configUrl | Configs URL
parameterMacro | MUST be a function. Function to set default value to parameters. Accepts two arguments parameterMacro(operation, parameter). Operation and parameter are objects passed for context, both remain immutable parameterMacro | MUST be a function. Function to set default value to parameters. Accepts two arguments parameterMacro(operation, parameter). Operation and parameter are objects passed for context, both remain immutable
modelPropertyMacro | MUST be a function. Function to set default values to each property in model. Accepts one argument modelPropertyMacro(property), property is immutable modelPropertyMacro | MUST be a function. Function to set default values to each property in model. Accepts one argument modelPropertyMacro(property), property is immutable
docExpansion | Controls the default expansion setting for the operations and tags. It can be 'list' (expands only the tags), 'full' (expands the tags and operations) or 'none' (expands nothing). The default is 'list'.
### Plugins ### Plugins

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AAyTA;;;;;;AAoIA;AAi7FA;AAmtCA;AAi0IA;AA0oJA;AAgwFA;AAyrGA;AA0lFA;AA4nFA;AA+9CA;AA+gDA;AAwrCA;AA60EA;;;;;AA6oCA;AAsyJA;;;;;;;;;;;;;;AA64EA;AA4mIA;AAquJA;AA2qHA;AA2mGA;AAiiEA;AAq4DA;AAg3DA;AAgRA;;;;;;AAs5FA;AA09FA;;;;;AA4jDA;AAgsFA;AAs2CA;AAglCA;AAu9CA;AAy8EA;AAsiCA;AA+yFA;;;;;;;;;AAgkDA;AA2zIA;AAu7FA;AAmrFA;AAu0EA","sourceRoot":""} {"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AAyTA;;;;;;AAoIA;AAi7FA;AAmtCA;AAi0IA;AA0oJA;AAgwFA;AAyrGA;AA0lFA;AA4nFA;AA+9CA;AA+gDA;AAwrCA;AA60EA;;;;;AA6oCA;AAsyJA;;;;;;;;;;;;;;AA64EA;AA4mIA;AAquJA;AA2qHA;AA2mGA;AAiiEA;AAq4DA;AAg3DA;AAoPA;;;;;;AAk7FA;AA07FA;;;;;AAi8CA;AAgsFA;AAs2CA;AAglCA;AAu9CA;AAy8EA;AAsiCA;AA+yFA;;;;;;;;;AAgkDA;AA2zIA;AAu7FA;AAmrFA;AAu0EA","sourceRoot":""}

2
dist/swagger-ui.js vendored

File diff suppressed because one or more lines are too long

18
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{ {
"name": "swagger-ui", "name": "swagger-ui",
"version": "3.0.12", "version": "3.0.13",
"lockfileVersion": 1, "lockfileVersion": 1,
"dependencies": { "dependencies": {
"abbrev": { "abbrev": {
@@ -2040,11 +2040,6 @@
"integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=", "integrity": "sha1-4QgOBljjALBilJkMxw4VAiNf1VA=",
"dev": true "dev": true
}, },
"fast-json-patch": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-1.2.0.tgz",
"integrity": "sha1-MDl+lVPCNuiR/Ue/f+0FhVQPJvs="
},
"fast-levenshtein": { "fast-levenshtein": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
@@ -6391,10 +6386,15 @@
} }
}, },
"swagger-client": { "swagger-client": {
"version": "3.0.12", "version": "3.0.13",
"resolved": "https://registry.npmjs.org/swagger-client/-/swagger-client-3.0.12.tgz", "resolved": "https://registry.npmjs.org/swagger-client/-/swagger-client-3.0.13.tgz",
"integrity": "sha1-gYQDhJ1cQq36GzhJ2GScBBq994I=", "integrity": "sha1-BF3QsOgVEFd7kIID8kZ/Fd9HMZQ=",
"dependencies": { "dependencies": {
"fast-json-patch": {
"version": "1.1.10",
"resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-1.1.10.tgz",
"integrity": "sha1-1OZzkgKrlIr4LdXyRJbKtze1xQo="
},
"lodash": { "lodash": {
"version": "4.16.2", "version": "4.16.2",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.16.2.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.16.2.tgz",

View File

@@ -1,6 +1,6 @@
{ {
"name": "swagger-ui", "name": "swagger-ui",
"version": "3.0.12", "version": "3.0.13",
"main": "dist/swagger-ui.js", "main": "dist/swagger-ui.js",
"repository": "git@github.com:swagger-api/swagger-ui.git", "repository": "git@github.com:swagger-api/swagger-ui.git",
"contributors": [ "contributors": [
@@ -70,7 +70,7 @@
"sanitize-html": "^1.14.1", "sanitize-html": "^1.14.1",
"serialize-error": "2.0.0", "serialize-error": "2.0.0",
"shallowequal": "0.2.2", "shallowequal": "0.2.2",
"swagger-client": "~3.0.12", "swagger-client": "~3.0.13",
"url-parse": "^1.1.8", "url-parse": "^1.1.8",
"whatwg-fetch": "0.11.1", "whatwg-fetch": "0.11.1",
"worker-loader": "^0.7.1", "worker-loader": "^0.7.1",

View File

@@ -70,7 +70,7 @@ export class Col extends React.Component {
} }
} }
let classes = xclass(rest.className, "clear", ...classesAr) let classes = xclass(rest.className, ...classesAr)
return ( return (
<section {...rest} style={{display: hide ? "none": null}} className={classes}/> <section {...rest} style={{display: hide ? "none": null}} className={classes}/>

View File

@@ -27,7 +27,8 @@ export default class Operation extends React.Component {
specSelectors: PropTypes.object.isRequired, specSelectors: PropTypes.object.isRequired,
layoutActions: PropTypes.object.isRequired, layoutActions: PropTypes.object.isRequired,
layoutSelectors: PropTypes.object.isRequired, layoutSelectors: PropTypes.object.isRequired,
fn: PropTypes.object.isRequired fn: PropTypes.object.isRequired,
getConfigs: PropTypes.func.isRequired
} }
static defaultProps = { static defaultProps = {
@@ -76,8 +77,10 @@ export default class Operation extends React.Component {
} }
isShown =() => { isShown =() => {
let { layoutSelectors, isShownKey } = this.props let { layoutSelectors, isShownKey, getConfigs } = this.props
return layoutSelectors.isShown(isShownKey, false ) // Here is where we set the default let { docExpansion } = getConfigs()
return layoutSelectors.isShown(isShownKey, docExpansion === "full" ) // Here is where we set the default
} }
onTryoutClick =() => { onTryoutClick =() => {

View File

@@ -10,6 +10,7 @@ export default class Operations extends React.Component {
layoutActions: PropTypes.object.isRequired, layoutActions: PropTypes.object.isRequired,
authActions: PropTypes.object.isRequired, authActions: PropTypes.object.isRequired,
authSelectors: PropTypes.object.isRequired, authSelectors: PropTypes.object.isRequired,
getConfigs: PropTypes.func.isRequired
}; };
static defaultProps = { static defaultProps = {
@@ -25,6 +26,7 @@ export default class Operations extends React.Component {
layoutActions, layoutActions,
authActions, authActions,
authSelectors, authSelectors,
getConfigs,
fn fn
} = this.props } = this.props
@@ -34,6 +36,7 @@ export default class Operations extends React.Component {
const Collapse = getComponent("Collapse") const Collapse = getComponent("Collapse")
let showSummary = layoutSelectors.showSummary() let showSummary = layoutSelectors.showSummary()
let { docExpansion } = getConfigs()
return ( return (
<div> <div>
@@ -43,7 +46,7 @@ export default class Operations extends React.Component {
let tagDescription = tagObj.getIn(["tagDetails", "description"], null) let tagDescription = tagObj.getIn(["tagDetails", "description"], null)
let isShownKey = ["operations-tag", tag] let isShownKey = ["operations-tag", tag]
let showTag = layoutSelectors.isShown(isShownKey, true) let showTag = layoutSelectors.isShown(isShownKey, docExpansion === "full" || docExpansion === "list")
return ( return (
<div className={showTag ? "opblock-tag-section is-open" : "opblock-tag-section"} key={"operation-" + tag}> <div className={showTag ? "opblock-tag-section is-open" : "opblock-tag-section"} key={"operation-" + tag}>
@@ -98,6 +101,7 @@ export default class Operations extends React.Component {
getComponent={ getComponent } getComponent={ getComponent }
fn={fn} fn={fn}
getConfigs={ getConfigs }
/> />
}).toArray() }).toArray()
} }

View File

@@ -24,6 +24,7 @@ module.exports = function SwaggerUI(opts) {
spec: {}, spec: {},
url: "", url: "",
layout: "BaseLayout", layout: "BaseLayout",
docExpansion: "list",
validatorUrl: "https://online.swagger.io/validator", validatorUrl: "https://online.swagger.io/validator",
configs: {}, configs: {},
custom: {}, custom: {},

View File

@@ -43,8 +43,6 @@ export const specResolved = createSelector(
// Default Spec ( as an object ) // Default Spec ( as an object )
export const spec = state => { export const spec = state => {
let res = specResolved(state) let res = specResolved(state)
if(res.count() < 1)
res = specJson(state)
return res return res
} }

View File

@@ -58,7 +58,7 @@
&.execute &.execute
{ {
animation: pulse 2s infinite; animation: swagger-ui-pulse 2s infinite;
color: #fff; color: #fff;
border-color: #4990e2; border-color: #4990e2;
@@ -66,7 +66,7 @@
} }
@keyframes pulse @keyframes swagger-ui-pulse
{ {
0% 0%
{ {