Compare commits

..
27 Commits
Author SHA1 Message Date
kyle 4eae9b681b Merge pull request #3835 from swagger-api/v/3.4.1
v3.4.1
2017-10-28 00:43:16 -07:00
Kyle Shockey bdc0435683 v3.4.1 2017-10-28 00:37:55 -07:00
kyle 3c371915af Merge pull request #3834 from swagger-api/bug/3818-definitions-to-authorize-cache-invalidation
memoize definitionsToAuthorize based on securityDefinitons value
2017-10-28 00:03:14 -07:00
kyle ba6e8d14a3 Merge branch 'master' into bug/3818-definitions-to-authorize-cache-invalidation 2017-10-27 23:55:25 -07:00
kyle b90a4d3c71 Merge pull request #3833 from swagger-api/bug/3811-oas3-enum-execute
Pass correct schema values to parameter state builder for OAS3
2017-10-27 23:55:17 -07:00
Kyle Shockey 2157988212 Don't reach into schema for value 2017-10-27 23:31:47 -07:00
Kyle Shockey 109f7ed430 memoize definitionsToAuthorize based on securityDefinitons value 2017-10-27 22:41:27 -07:00
Kyle Shockey 79ddae1526 Pass correct schema values to parameter state builder for OAS3 2017-10-27 22:23:11 -07:00
kyle ac36d46467 Merge pull request #3829 from swagger-api/pull-request-template
Create pull request template
2017-10-27 13:01:14 -07:00
kyle b3a8e4d380 Merge branch 'master' into pull-request-template 2017-10-27 12:44:23 -07:00
kyle c33a37d8db Merge pull request #3831 from swagger-api/bug/3816-oas3-authorize-always-showing
Return null instead of empty ImmutableMap in OAS3 securityDefinitions selector
2017-10-26 15:55:32 -07:00
kyle 2caca555b1 Merge branch 'master' into bug/3816-oas3-authorize-always-showing 2017-10-26 15:49:05 -07:00
Kyle Shockey 7159649501 Return null instead of empty ImmutableMap in OAS3 securityDefinitions selector 2017-10-26 15:32:14 -07:00
kyle 3e7a0764bb Merge pull request #3830 from swagger-api/bug/resolver-interception
Provide interceptors to SwaggerClient.resolve
2017-10-26 15:06:32 -07:00
kyle 35f1e94c04 Merge branch 'master' into bug/resolver-interception 2017-10-26 14:58:56 -07:00
Kyle Shockey 26428cd63b Provide interceptors to SwaggerClient.resolve 2017-10-26 14:51:00 -07:00
kyle 896e160e2b Improve spacing and section header sizes 2017-10-26 12:08:52 -07:00
kyle 565318739c Add no code changes and dependency changes 2017-10-26 12:02:06 -07:00
kyle f5217f9c99 Merge pull request #3828 from swagger-api/shockey-patch-1
Improve UX
2017-10-26 11:59:09 -07:00
kyle cb9804b5ca Create pull_request_template.md 2017-10-26 11:58:54 -07:00
kyle 8f0b498374 Update add-plugin.md 2017-10-26 10:59:06 -07:00
kyle 71c33d0af8 Update topbar.jsx 2017-10-26 10:57:36 -07:00
Ron c2bdb3af24 Merge pull request #3810 from iiska/relative-json-path
Fix accessing bundled swagger json behind reverse proxy
2017-10-24 09:58:25 -07:00
Juhamatti Niemelä 6dd5d80770 Fix accessing bundled swagger json behind reverse proxy
If swagger-ui is run behind reverse proxy in path other than / accessing
bundled swagger json configured in SWAGGER_JSON env variable will fail.

Fix that by changing REL_PATH prefix from `/` to `./`
2017-10-24 16:42:51 +03:00
kyle 96b0b04538 Merge pull request #3799 from swagger-api/bug/mocha-exclusive-tests
Add ESLint rule that catches `describe.only`, `it.only`
2017-10-21 12:25:36 -07:00
Kyle Shockey 075c94f68c Remove describe.only 2017-10-21 11:13:01 -07:00
Kyle Shockey fc11f7a556 Add ESLint rule that catches describe.only, it.only 2017-10-21 11:11:13 -07:00
18 changed files with 140 additions and 98 deletions
+4 -2
View File
@@ -16,7 +16,8 @@
"extends": ["eslint:recommended", "plugin:react/recommended"],
"plugins": [
"react"
"react",
"mocha"
],
"rules": {
@@ -32,6 +33,7 @@
"comma-dangle": 0,
"no-console": ["error", { allow: ["warn", "error"] }],
"react/jsx-no-bind": 1,
"react/display-name": 0
"react/display-name": 0,
"mocha/no-exclusive-tests": "error"
}
}
+42
View File
@@ -0,0 +1,42 @@
<!--- Provide a general summary of your changes in the Title above -->
### Description
<!--- Describe your changes in detail -->
### Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
<!--- Use the magic "Fixes #1234" format, so the issues are -->
<!--- automatically closed when this PR is merged. -->
### How Has This Been Tested?
<!--- Please describe in detail how you manually tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
### Screenshots (if appropriate):
### Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] No code changes (changes to documentation, CI, metadata, etc)
- [ ] Dependency changes (any modification to dependencies in `package.json`)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
### Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
+1 -1
View File
@@ -22,7 +22,7 @@ The OpenAPI Specification has undergone 5 revisions since initial creation in 20
Swagger UI Version | Release Date | OpenAPI Spec compatibility | Notes
------------------ | ------------ | -------------------------- | -----
3.4.0 | 2017-10-20 | 2.0, 3.0 | [tag v3.4.0](https://github.com/swagger-api/swagger-ui/tree/v3.4.0)
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)
3.0.21 | 2017-07-26 | 2.0 | [tag v3.0.21](https://github.com/swagger-api/swagger-ui/tree/v3.0.21)
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)
+49 -75
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -32,7 +32,7 @@ fi
if [[ -f $SWAGGER_JSON ]]; then
cp $SWAGGER_JSON $NGINX_ROOT
REL_PATH="/$(basename $SWAGGER_JSON)"
REL_PATH="./$(basename $SWAGGER_JSON)"
sed -i "s|http://petstore.swagger.io/v2/swagger.json|$REL_PATH|g" $INDEX_FILE
sed -i "s|http://example.com/api|$REL_PATH|g" $INDEX_FILE
else
+3 -2
View File
@@ -1,6 +1,6 @@
{
"name": "swagger-ui",
"version": "3.4.0",
"version": "3.4.1",
"main": "dist/swagger-ui.js",
"repository": "git@github.com:swagger-api/swagger-ui.git",
"contributors": [
@@ -78,7 +78,7 @@
"scroll-to-element": "^2.0.0",
"serialize-error": "2.0.0",
"shallowequal": "0.2.2",
"swagger-client": "^3.3.0",
"swagger-client": "^3.3.1",
"url-parse": "^1.1.8",
"whatwg-fetch": "0.11.1",
"worker-loader": "^0.7.1",
@@ -105,6 +105,7 @@
"enzyme": "^2.7.1",
"eslint": "^4.1.1",
"eslint-plugin-import": "^2.6.0",
"eslint-plugin-mocha": "^4.11.0",
"eslint-plugin-react": "^7.1.0",
"extract-text-webpack-plugin": "^2.1.2",
"file-loader": "0.11.2",
+12 -1
View File
@@ -1,4 +1,5 @@
import React, { Component } from "react"
import { Map } from "immutable"
import PropTypes from "prop-types"
import win from "core/window"
@@ -29,11 +30,21 @@ export default class ParameterRow extends Component {
componentWillReceiveProps(props) {
let { specSelectors, pathMethod, param } = props
let { isOAS3 } = specSelectors
let example = param.get("example")
let defaultValue = param.get("default")
let parameter = specSelectors.getParameter(pathMethod, param.get("name"), param.get("in"))
let enumValue
if(isOAS3()) {
let schema = param.get("schema") || Map()
enumValue = schema.get("enum")
} else {
enumValue = parameter ? parameter.get("enum") : undefined
}
let paramValue = parameter ? parameter.get("value") : undefined
let enumValue = parameter ? parameter.get("enum") : undefined
let value
if ( paramValue !== undefined ) {
@@ -20,10 +20,10 @@ function onlyOAS3(selector) {
export const definitionsToAuthorize = onlyOAS3(createSelector(
state,
({ specSelectors }) => {
({specSelectors}) => specSelectors.securityDefinitions(),
(system, definitions) => {
// Coerce our OpenAPI 3.0 definitions into monoflow definitions
// that look like Swagger2 definitions.
let definitions = specSelectors.securityDefinitions()
let list = List()
definitions.entrySeq().forEach( ([ defName, definition ]) => {
@@ -57,4 +57,4 @@ export const definitionsToAuthorize = onlyOAS3(createSelector(
return list
}
))
))
@@ -50,7 +50,7 @@ export const definitions = onlyOAS3(createSelector(
export const securityDefinitions = onlyOAS3(createSelector(
spec,
spec => spec.getIn(["components", "securitySchemes"]) || Map()
spec => spec.getIn(["components", "securitySchemes"]) || null
))
export const host = OAS3NullSelector
+16 -4
View File
@@ -80,7 +80,12 @@ export const parseToJson = (str) => ({specActions, specSelectors, errActions}) =
}
export const resolveSpec = (json, url) => ({specActions, specSelectors, errActions, fn: { fetch, resolve, AST }, getConfigs}) => {
const { modelPropertyMacro, parameterMacro } = getConfigs()
const {
modelPropertyMacro,
parameterMacro,
requestInterceptor,
responseInterceptor
} = getConfigs()
if(typeof(json) === "undefined") {
json = specSelectors.specJson()
@@ -93,8 +98,15 @@ export const resolveSpec = (json, url) => ({specActions, specSelectors, errActio
let specStr = specSelectors.specStr()
return resolve({fetch, spec: json, baseDoc: url, modelPropertyMacro, parameterMacro })
.then( ({spec, errors}) => {
return resolve({
fetch,
spec: json,
baseDoc: url,
modelPropertyMacro,
parameterMacro,
requestInterceptor,
responseInterceptor
}).then( ({spec, errors}) => {
errActions.clear({
type: "thrown"
})
@@ -140,7 +152,7 @@ export function changeParam( path, paramName, paramIn, value, isXml ){
export const validateParams = ( payload, isOAS3 ) =>{
return {
type: VALIDATE_PARAMS,
payload:{
payload:{
pathMethod: payload,
isOAS3
}
+1 -1
View File
@@ -1,6 +1,6 @@
# Add a plugin
### Swagger-UX relies on plugins for all the good stuff.
### Swagger-UI relies on plugins for all the good stuff.
Plugins allow you to add
- `statePlugins`
+1 -1
View File
@@ -129,7 +129,7 @@ export default class Topbar extends React.Component {
<div className="topbar">
<div className="wrapper">
<div className="topbar-wrapper">
<Link href="#" title="Swagger UX">
<Link href="#">
<img height="30" width="30" src={ Logo } alt="Swagger UI"/>
<span>swagger</span>
</Link>
@@ -5,7 +5,7 @@ import {
definitionsToAuthorize
} from "corePlugins/oas3/auth-extensions/wrap-selectors"
describe.only("oas3 plugin - auth extensions - wrapSelectors", function(){
describe("oas3 plugin - auth extensions - wrapSelectors", function(){
describe("execute", function(){