diff --git a/README.md b/README.md index 0144744e..dac53d35 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ displayOperationId | Controls the display of operationId in operations list. The displayRequestDuration | Controls the display of the request duration (in milliseconds) for `Try it out` requests. The default is `false`. maxDisplayedTags | If set, limits the number of tagged operations displayed to at most this many. The default is to show all operations. filter | If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be true/false to enable or disable, or an explicit filter string in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag. +deepLinking | If set to `true`, enables dynamic deep linking for tags and operations. [Docs](https://github.com/swagger-api/swagger-ui/blob/master/docs/deep-linking.md) ### Plugins @@ -235,6 +236,10 @@ Access-Control-Allow-Headers: Content-Type, api_key, Authorization Only headers with these names will be allowed to be sent by Swagger-UI. +## Security contact + +Please disclose any security-related issues or vulnerabilities by emailing [security@swagger.io](mailto:security@swagger.io), instead of using the public issue tracker. + ## License Copyright 2017 SmartBear Software diff --git a/dist/index.html b/dist/index.html index f6aaf9e4..52590951 100644 --- a/dist/index.html +++ b/dist/index.html @@ -76,6 +76,7 @@ window.onload = function() { const ui = SwaggerUIBundle({ url: "http://petstore.swagger.io/v2/swagger.json", dom_id: '#swagger-ui', + deepLinking: true, presets: [ SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset diff --git a/make-webpack-config.js b/make-webpack-config.js index 2a6ed131..2eeb9bf9 100644 --- a/make-webpack-config.js +++ b/make-webpack-config.js @@ -61,7 +61,6 @@ module.exports = function(rules, options) { } if( specialOptions.minimize ) { - plugins.push( new webpack.optimize.UglifyJsPlugin({ sourceMap: true, diff --git a/package.json b/package.json index 4b754ce7..3e0465d7 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,6 @@ "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "2.0.3", "less": "2.7.2", - "less-loader": "4.0.4", "license-checker": "^11.0.0", "mocha": "^3.4.2", "node-sass": "^4.5.0", diff --git a/src/core/components/info.jsx b/src/core/components/info.jsx index 6ea1ed48..5e2b368a 100644 --- a/src/core/components/info.jsx +++ b/src/core/components/info.jsx @@ -15,7 +15,7 @@ class Path extends React.Component { return (
-        [ Base url: {host}{basePath}]
+        [ Base URL: {host}{basePath} ]
       
) } diff --git a/src/core/components/layout-utils.jsx b/src/core/components/layout-utils.jsx index 00a4a09d..f80e0c90 100644 --- a/src/core/components/layout-utils.jsx +++ b/src/core/components/layout-utils.jsx @@ -129,7 +129,8 @@ export class Select extends React.Component { value: PropTypes.any, onChange: PropTypes.func, multiple: PropTypes.bool, - allowEmptyValue: PropTypes.bool + allowEmptyValue: PropTypes.bool, + className: PropTypes.string } static defaultProps = { @@ -142,7 +143,7 @@ export class Select extends React.Component { let value - if (props.value !== undefined) { + if (props.value) { value = props.value } else { value = props.multiple ? [""] : "" @@ -178,7 +179,7 @@ export class Select extends React.Component { let value = this.state.value.toJS ? this.state.value.toJS() : this.state.value return ( - { allowEmptyValue ? : null } { allowedValues.map(function (item, key) { diff --git a/src/core/components/models.jsx b/src/core/components/models.jsx index c61ae0c9..86c3256d 100644 --- a/src/core/components/models.jsx +++ b/src/core/components/models.jsx @@ -24,8 +24,8 @@ export default class Models extends Component { return

layoutActions.show("models", !showModels)}> Models - - + +

diff --git a/src/core/components/schemes.jsx b/src/core/components/schemes.jsx index 8be4180a..f9fe8f81 100644 --- a/src/core/components/schemes.jsx +++ b/src/core/components/schemes.jsx @@ -19,8 +19,9 @@ export default class Schemes extends React.Component { } componentWillReceiveProps(nextProps) { - if ( this.props.operationScheme && !nextProps.schemes.has(this.props.operationScheme) ) { - //fire 'change' event if our selected scheme is no longer an option + if ( !this.props.operationScheme || !nextProps.schemes.has(this.props.operationScheme) ) { + // if we don't have a selected operationScheme or if our selected scheme is no longer an option, + // then fire 'change' event and select the first scheme in the list of options this.setScheme(nextProps.schemes.first()) } } diff --git a/src/core/json-schema-components.js b/src/core/json-schema-components.js index bf4ae514..338bd6e3 100644 --- a/src/core/json-schema-components.js +++ b/src/core/json-schema-components.js @@ -57,7 +57,8 @@ export class JsonSchema_string extends Component { if ( enumValue ) { const Select = getComponent("Select") - return () } - let errors = schema.errors || [] - return (
- { !value || value.count() < 1 ? - (errors.length ? { errors[0] } : null) : + { !value || value.count() < 1 ? null : value.map( (item,i) => { let schema = Object.assign({}, itemSchema) if ( errors.length ) { @@ -153,12 +153,12 @@ export class JsonSchema_array extends PureComponent { return (
this.onItemChange(val, i)} schema={schema} /> - +
) }).toArray() } - +
) } @@ -170,12 +170,14 @@ export class JsonSchema_boolean extends Component { onEnumChange = (val) => this.props.onChange(val) render() { - let { getComponent, required, value } = this.props + let { getComponent, value, schema } = this.props + let errors = schema.errors || [] const Select = getComponent("Select") - return (