Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfe5963978 | ||
|
|
e0e6ccc6d3 | ||
|
|
965cfd349c | ||
|
|
c46566a904 | ||
|
|
ed9e94f506 | ||
|
|
ade4dd4e68 | ||
|
|
a8f9f5c791 | ||
|
|
02d55a096b | ||
|
|
d2e20a72f0 | ||
|
|
af0088ccca | ||
|
|
879fc4ce04 | ||
|
|
38737da9e9 | ||
|
|
161dc57cd5 | ||
|
|
1df4df67c1 | ||
|
|
432cd7f965 | ||
|
|
b34e363ae1 | ||
|
|
229bd1df9a | ||
|
|
ec46a22df5 | ||
|
|
0b668ccf2a | ||
|
|
c38bf2a0b1 | ||
|
|
ded299d891 | ||
|
|
374b3613d0 | ||
|
|
eff72c21df | ||
|
|
995ca2bf3d | ||
|
|
a09412d712 | ||
|
|
7d215a9ef7 | ||
|
|
29ecbea269 | ||
|
|
431b67362c | ||
|
|
bd0fbc60dd | ||
|
|
b8e1f1ceeb | ||
|
|
a13dc1ede1 | ||
|
|
822dda8fc8 | ||
|
|
85d7ec52e7 |
+14
@@ -1,11 +1,15 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- '6.9'
|
||||
services:
|
||||
- docker
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||
before_deploy: "npm run build-core"
|
||||
env:
|
||||
- DOCKER_IMAGE_NAME=swaggerapi/swagger-ui
|
||||
deploy:
|
||||
provider: npm
|
||||
email: apiteam@swagger.io
|
||||
@@ -16,3 +20,13 @@ deploy:
|
||||
tags: true
|
||||
repo: swagger-api/swagger-ui
|
||||
node: '6.9'
|
||||
after_success:
|
||||
- if [ $DOCKER_HUB_USERNAME ]; then
|
||||
docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD;
|
||||
docker build -t $DOCKER_IMAGE_NAME .;
|
||||
if [ "$TRAVIS_TAG" != "master" && -z "$TRAVIS_TAG"]; then
|
||||
docker tag $DOCKER_IMAGE_NAME $DOCKER_IMAGE_NAME:$TRAVIS_TAG;
|
||||
fi;
|
||||
|
||||
docker push $DOCKER_IMAGE_NAME;
|
||||
fi;
|
||||
|
||||
@@ -15,7 +15,7 @@ The OpenAPI Specification has undergone 4 revisions since initial creation in 20
|
||||
|
||||
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes | Status
|
||||
------------------ | ------------ | -------------------------- | ----- | ------
|
||||
3.0.3 | 2017-03-19 | 2.0 | [tag v3.0.3](https://github.com/swagger-api/swagger-ui/tree/v3.0.3) |
|
||||
3.0.4 | 2017-03-19 | 2.0 | [tag v3.0.4](https://github.com/swagger-api/swagger-ui/tree/v3.0.4) |
|
||||
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.0.24 | 2014-09-12 | 1.1, 1.2 | [tag v2.0.24](https://github.com/swagger-api/swagger-ui/tree/v2.0.24) |
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
<!-- HTML for dev server -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Swagger UI</title>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600|Titillium+Web:400,600,700" rel="stylesheet">
|
||||
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
|
||||
<link rel="icon" type="image/png" href="../public/favicon-32x32.png" sizes="32x32" />
|
||||
<link rel="icon" type="image/png" href="../public/favicon-16x16.png" sizes="16x16" />
|
||||
<style>
|
||||
html
|
||||
{
|
||||
box-sizing: border-box;
|
||||
overflow: -moz-scrollbars-vertical;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
*,
|
||||
*:before,
|
||||
*:after
|
||||
{
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
body {
|
||||
margin:0;
|
||||
background: #fafafa;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0">
|
||||
<defs>
|
||||
<symbol viewBox="0 0 20 20" id="unlocked">
|
||||
<path d="M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"></path>
|
||||
</symbol>
|
||||
|
||||
<symbol viewBox="0 0 20 20" id="locked">
|
||||
<path d="M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z"/>
|
||||
</symbol>
|
||||
|
||||
<symbol viewBox="0 0 20 20" id="close">
|
||||
<path d="M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"/>
|
||||
</symbol>
|
||||
|
||||
<symbol viewBox="0 0 20 20" id="large-arrow">
|
||||
<path d="M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z"/>
|
||||
</symbol>
|
||||
|
||||
<symbol viewBox="0 0 20 20" id="large-arrow-down">
|
||||
<path d="M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z"/>
|
||||
</symbol>
|
||||
|
||||
|
||||
<symbol viewBox="0 0 24 24" id="jump-to">
|
||||
<path d="M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"/>
|
||||
</symbol>
|
||||
|
||||
<symbol viewBox="0 0 24 24" id="expand">
|
||||
<path d="M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"/>
|
||||
</symbol>
|
||||
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
<div id="swagger-ui"></div>
|
||||
|
||||
<script src="./swagger-ui-bundle.js"> </script>
|
||||
<script src="./swagger-ui-standalone-preset.js"> </script>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
window["SwaggerUIBundle"] = window["swagger-ui-bundle"]
|
||||
window["SwaggerUIStandalonePreset"] = window["swagger-ui-standalone-preset"]
|
||||
// Build a system
|
||||
const ui = SwaggerUIBundle({
|
||||
url: "http://petstore.swagger.io/v2/swagger.json",
|
||||
dom_id: '#swagger-ui',
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
layout: "StandaloneLayout"
|
||||
})
|
||||
|
||||
window.ui = ui
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Vendored
+1
-2
@@ -77,8 +77,7 @@ window.onload = function() {
|
||||
dom_id: '#swagger-ui',
|
||||
presets: [
|
||||
SwaggerUIBundle.presets.apis,
|
||||
// yay ES6 modules ↘
|
||||
Array.isArray(SwaggerUIStandalonePreset) ? SwaggerUIStandalonePreset : SwaggerUIStandalonePreset.default
|
||||
SwaggerUIStandalonePreset
|
||||
],
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
|
||||
Vendored
+45
-46
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AAsdA;AAkoJA;AAyiCA;;;;;AAskCA;AAq7IA;AAo7FA;AA0wGA;AAgmEA;AA+9CA;AA0gDA;AA0rCA;AAm6DA;AAm4IA;;;;;;;;;;;;;;AAmtFA;AAyoIA;AAiuJA;AAglHA;AA+mGA;AAmkEA;AA42DA;AAwxDA;AA69BA;;;;;;AAixEA;AAo2FA;;;;;AA23CA;AA2qFA;AAo2CA;AAihCA;AAomDA;AAiuEA;AAkjGA;;;;;;;;;AAkpBA;AA2zIA;AAg4DA;AAywDA;;;;;;AAyzBA;AA8iHA;AAipGA","sourceRoot":""}
|
||||
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AAsdA;;;;;;AAoIA;AAk7FA;AAmtCA;;;;;AA0uIA;AAq7IA;AAo7FA;AA0wGA;AAglFA;AA0jFA;AAq9CA;AA6jDA;AAgrCA;AAgtEA;AAgkIA;;;;;;;;;;;;;;AAw4GA;AAyoIA;AAiuJA;AA8kHA;AAonGA;AAukEA;AA02DA;AAyxDA;AAm+BA;;;;;;AAmsEA;AA2zFA;;;;;AA+1CA;AA2qFA;AAo2CA;AAokCA;AAkhDA;AAwvEA;AAs+FA;;;;;;;;;AA+xBA;AA2zIA;AAg4DA;AA0vDA","sourceRoot":""}
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+8
-8
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;AAsoGA;AAy4HA;AA67FA;AA4mCA;AAs+BA;AAsiCA;AAm5BA","sourceRoot":""}
|
||||
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;AAsoGA;AAy4HA;AA+7FA;AA2mCA;AAw/BA;AA2hCA;AAs5BA","sourceRoot":""}
|
||||
+4
-7
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "swagger-ui",
|
||||
"version": "3.0.3",
|
||||
"version": "3.0.4",
|
||||
"main": "dist/swagger-ui.js",
|
||||
"repository": "git@github.com:swagger-api/swagger-ui.git",
|
||||
"contributors": [
|
||||
@@ -22,7 +22,7 @@
|
||||
"dev": "npm-run-all --parallel hot-server watch open-localhost",
|
||||
"watch": "webpack --config webpack-watch.config.js --watch --progress",
|
||||
"open-localhost": "node -e 'require(\"open\")(\"http://localhost:3200\")'",
|
||||
"hot-server": "webpack-dev-server --host 0.0.0.0 --config webpack-hot-dev-server.config.js --inline --hot --progress --content-base dist/",
|
||||
"hot-server": "webpack-dev-server --host 0.0.0.0 --config webpack-hot-dev-server.config.js --inline --hot --progress --content-base dev-helpers/",
|
||||
"deps-license": "license-checker --production --csv --out $npm_package_config_deps_check_dir/licenses.csv && license-checker --development --csv --out $npm_package_config_deps_check_dir/licenses-dev.csv",
|
||||
"deps-size": "webpack -p --config webpack.check.js --json | webpack-bundle-size-analyzer >| $npm_package_config_deps_check_dir/sizes.txt",
|
||||
"deps-check": "npm run deps-license && npm run deps-size",
|
||||
@@ -38,13 +38,11 @@
|
||||
"babel-polyfill": "^6.23.0",
|
||||
"brace": "0.7.0",
|
||||
"btoa": "^1.1.2",
|
||||
"debounce": "1.0.0",
|
||||
"deep-extend": "0.4.1",
|
||||
"expect": "1.20.2",
|
||||
"getbase": "^2.8.2",
|
||||
"immutable": "^3.x.x",
|
||||
"js-yaml": "^3.5.5",
|
||||
"jsonschema": "^1.1.0",
|
||||
"less": "2.7.1",
|
||||
"lodash": "4.17.2",
|
||||
"matcher": "^0.1.2",
|
||||
@@ -70,12 +68,11 @@
|
||||
"reselect": "2.5.3",
|
||||
"serialize-error": "2.0.0",
|
||||
"shallowequal": "0.2.2",
|
||||
"swagger-client": "^3.0.3",
|
||||
"swagger-client": "^3.0.4",
|
||||
"whatwg-fetch": "0.11.1",
|
||||
"worker-loader": "^0.7.1",
|
||||
"xml": "1.0.1",
|
||||
"yaml-js": "^0.1.3",
|
||||
"yaml-worker": "^2.1.0"
|
||||
"yaml-js": "^0.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "6.6.1",
|
||||
|
||||
@@ -10,14 +10,13 @@ export default class Oauth2 extends React.Component {
|
||||
static propTypes = {
|
||||
name: PropTypes.string,
|
||||
authorized: PropTypes.object,
|
||||
configs: PropTypes.object,
|
||||
getComponent: PropTypes.func.isRequired,
|
||||
schema: PropTypes.object.isRequired,
|
||||
authSelectors: PropTypes.object.isRequired,
|
||||
authActions: PropTypes.object.isRequired,
|
||||
errSelectors: PropTypes.object.isRequired,
|
||||
errActions: PropTypes.object.isRequired,
|
||||
getConfigs: PropTypes.function
|
||||
getConfigs: PropTypes.any
|
||||
}
|
||||
|
||||
constructor(props, context) {
|
||||
@@ -173,7 +172,7 @@ export default class Oauth2 extends React.Component {
|
||||
}
|
||||
|
||||
{
|
||||
!isAuthorized && flow !== PASSWORD && scopes && scopes.size ? <div className="scopes">
|
||||
!isAuthorized && scopes && scopes.size ? <div className="scopes">
|
||||
<h2>Scopes:</h2>
|
||||
{ scopes.map((description, name) => {
|
||||
return (
|
||||
|
||||
@@ -168,7 +168,10 @@ class ArrayModel extends Component {
|
||||
let { required, schema, depth, expandDepth } = this.props
|
||||
let items = schema.get("items")
|
||||
|
||||
return <span>
|
||||
return <span className="model">
|
||||
<span className="model-title">
|
||||
<span className="model-title__text">{ schema.get("title") }</span>
|
||||
</span>
|
||||
<Collapse collapsed={ depth > expandDepth } collapsedContent="[...]">
|
||||
[
|
||||
<span><Model { ...this.props } schema={ items } required={ false }/></span>
|
||||
|
||||
@@ -13,7 +13,7 @@ export default class OnlineValidatorBadge extends React.Component {
|
||||
let { validatorUrl } = getConfigs()
|
||||
this.state = {
|
||||
url: specSelectors.url(),
|
||||
validatorUrl: validatorUrl || "https://online.swagger.io/validator"
|
||||
validatorUrl: validatorUrl === undefined ? "https://online.swagger.io/validator" : validatorUrl
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export default class OnlineValidatorBadge extends React.Component {
|
||||
|
||||
this.setState({
|
||||
url: specSelectors.url(),
|
||||
validatorUrl: validatorUrl || "https://online.swagger.io/validator"
|
||||
validatorUrl: validatorUrl === undefined ? "https://online.swagger.io/validator" : validatorUrl
|
||||
})
|
||||
}
|
||||
|
||||
@@ -33,14 +33,72 @@ export default class OnlineValidatorBadge extends React.Component {
|
||||
|
||||
if ( typeof spec === "object" && Object.keys(spec).length) return null
|
||||
|
||||
if (!this.state.url) {
|
||||
if (!this.state.url || !this.state.validatorUrl || this.state.url.indexOf("localhost") >= 0
|
||||
|| this.state.url.indexOf("127.0.0.1") >= 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (<span style={{ float: "right"}}>
|
||||
<a target="_blank" href={`${ this.state.validatorUrl }/debug?url=${ this.state.url }`}>
|
||||
<img alt="Online validator badge" src={`${ this.state.validatorUrl }?url=${ this.state.url }`} />
|
||||
<ValidatorImage src={`${ this.state.validatorUrl }?url=${ this.state.url }`} alt="Online validator badge"/>
|
||||
</a>
|
||||
</span>)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ValidatorImage extends React.Component {
|
||||
static propTypes = {
|
||||
src: PropTypes.string,
|
||||
alt: PropTypes.string
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
loaded: false,
|
||||
error: false
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const img = new Image()
|
||||
img.onload = () => {
|
||||
this.setState({
|
||||
loaded: true
|
||||
})
|
||||
}
|
||||
img.onerror = () => {
|
||||
this.setState({
|
||||
error: true
|
||||
})
|
||||
}
|
||||
img.src = this.props.src
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.src !== this.props.src) {
|
||||
const img = new Image()
|
||||
img.onload = () => {
|
||||
this.setState({
|
||||
loaded: true
|
||||
})
|
||||
}
|
||||
img.onerror = () => {
|
||||
this.setState({
|
||||
error: true
|
||||
})
|
||||
}
|
||||
img.src = nextProps.src
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.error) {
|
||||
return <img alt={"Error"} />
|
||||
} else if (!this.state.loaded) {
|
||||
return <img alt= {"Loading..."} />
|
||||
}
|
||||
return <img src={this.props.src} alt={this.props.alt} />
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -14,8 +14,8 @@ module.exports = function SwaggerUI(opts) {
|
||||
spec: {},
|
||||
url: "",
|
||||
layout: "Layout",
|
||||
validatorUrl: "https://online.swagger.io/validator",
|
||||
configs: {
|
||||
validatorUrl: "https://online.swagger.io/validator"
|
||||
},
|
||||
|
||||
// Initial set of plugins ( TODO rename this, or refactor - we don't need presets _and_ plugins. Its just there for performance.
|
||||
|
||||
@@ -8,6 +8,8 @@ export const PRE_AUTHORIZE_OAUTH2 = "pre_authorize_oauth2"
|
||||
export const AUTHORIZE_OAUTH2 = "authorize_oauth2"
|
||||
export const VALIDATE = "validate"
|
||||
|
||||
const scopeSeparator = " "
|
||||
|
||||
export function showDefinitions(payload) {
|
||||
return {
|
||||
type: SHOW_AUTH_POPUP,
|
||||
@@ -77,7 +79,8 @@ export const authorizePassword = ( auth ) => ( { fn, authActions, errActions } )
|
||||
query: {
|
||||
grant_type: "password",
|
||||
username,
|
||||
password
|
||||
password,
|
||||
scopes: encodeURIComponent(auth.scopes.join(scopeSeparator))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,4 +14,4 @@ let preset = [
|
||||
}
|
||||
]
|
||||
|
||||
export default preset
|
||||
module.exports = preset
|
||||
|
||||
@@ -79,7 +79,7 @@ export default class StandaloneLayout extends React.Component {
|
||||
</div>
|
||||
) : null }
|
||||
|
||||
{ !schemes && securityDefinitions ? (
|
||||
{ (!schemes || !schemes.size) && securityDefinitions ? (
|
||||
<div className="scheme-container">
|
||||
<Col className="schemes wrapper" mobile={12}>
|
||||
{ securityDefinitions ? (
|
||||
|
||||
@@ -9,11 +9,11 @@ module.exports = require("./make-webpack-config")({
|
||||
},
|
||||
devtool: "eval",
|
||||
entry: {
|
||||
'SwaggerUIBundle': [
|
||||
'swagger-ui-bundle': [
|
||||
'babel-polyfill',
|
||||
'./src/core/index.js'
|
||||
],
|
||||
'SwaggerUIStandalonePreset': [
|
||||
'swagger-ui-standalone-preset': [
|
||||
'./src/standalone/index.js'
|
||||
]
|
||||
},
|
||||
@@ -27,8 +27,8 @@ module.exports = require("./make-webpack-config")({
|
||||
},
|
||||
devServer: {
|
||||
port: 3200,
|
||||
path: path.join(__dirname, 'dist'),
|
||||
publicPath: "/dist",
|
||||
path: path.join(__dirname, 'dev-helpers'),
|
||||
publicPath: "/",
|
||||
noInfo: true,
|
||||
colors: true,
|
||||
hot: true,
|
||||
|
||||
Reference in New Issue
Block a user