Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Sunny_yiyi
Swagger Ui
提交
b373182a
S
Swagger Ui
项目概览
Sunny_yiyi
/
Swagger Ui
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Swagger Ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b373182a
编写于
7月 28, 2017
作者:
K
Kyle Shockey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ESLint fixes
上级
f7018bc7
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
58 addition
and
20 deletion
+58
-20
src/core/components/response.jsx
src/core/components/response.jsx
+3
-2
src/core/components/version-stamp.jsx
src/core/components/version-stamp.jsx
+8
-1
src/core/plugins/oas3/components/callbacks.jsx
src/core/plugins/oas3/components/callbacks.jsx
+13
-4
src/core/plugins/oas3/components/operation-link.jsx
src/core/plugins/oas3/components/operation-link.jsx
+10
-1
src/core/plugins/oas3/components/request-body.jsx
src/core/plugins/oas3/components/request-body.jsx
+12
-1
src/core/plugins/oas3/wrap-components/model.jsx
src/core/plugins/oas3/wrap-components/model.jsx
+2
-1
src/core/plugins/oas3/wrap-components/online-validator-badge.js
...re/plugins/oas3/wrap-components/online-validator-badge.js
+0
-1
src/core/plugins/oas3/wrap-components/parameters.jsx
src/core/plugins/oas3/wrap-components/parameters.jsx
+2
-5
src/core/plugins/oas3/wrap-components/try-it-out-button.jsx
src/core/plugins/oas3/wrap-components/try-it-out-button.jsx
+0
-1
src/core/plugins/spec/selectors.js
src/core/plugins/spec/selectors.js
+3
-1
test/.eslintrc
test/.eslintrc
+3
-0
test/core/system/system.js
test/core/system/system.js
+2
-2
未找到文件。
src/core/components/response.jsx
浏览文件 @
b373182a
...
...
@@ -79,14 +79,15 @@ export default class Response extends React.Component {
const
ContentType
=
getComponent
(
"
contentType
"
)
var
sampleResponse
var
schema
if
(
isOAS3
())
{
let
oas3SchemaForContentType
=
response
.
getIn
([
"
content
"
,
this
.
state
.
responseContentType
,
"
schema
"
])
sampleResponse
=
oas3SchemaForContentType
?
getSampleSchema
(
oas3SchemaForContentType
.
toJS
(),
this
.
state
.
responseContentType
,
{
includeReadOnly
:
true
})
:
null
var
schema
=
oas3SchemaForContentType
?
inferSchema
(
oas3SchemaForContentType
.
toJS
())
:
null
schema
=
oas3SchemaForContentType
?
inferSchema
(
oas3SchemaForContentType
.
toJS
())
:
null
}
else
{
sampleResponse
=
schema
?
getSampleSchema
(
schema
,
contentType
,
{
includeReadOnly
:
true
})
:
null
var
schema
=
inferSchema
(
response
.
toJS
())
schema
=
inferSchema
(
response
.
toJS
())
}
let
example
=
getExampleComponent
(
sampleResponse
,
examples
,
HighlightCode
)
...
...
src/core/components/version-stamp.jsx
浏览文件 @
b373182a
import
React
from
"
react
"
import
PropTypes
from
"
prop-types
"
export
default
({
version
})
=>
{
const
VersionStamp
=
({
version
})
=>
{
return
<
small
><
pre
className
=
"version"
>
{
version
}
</
pre
></
small
>
}
VersionStamp
.
propTypes
=
{
version
:
PropTypes
.
string
.
isRequired
}
export
default
VersionStamp
src/core/plugins/oas3/components/callbacks.jsx
浏览文件 @
b373182a
import
React
from
"
react
"
import
PropTypes
from
"
prop-types
"
export
default
(
props
)
=>
{
const
Callbacks
=
(
props
)
=>
{
let
{
callbacks
,
getComponent
}
=
props
const
Markdown
=
getComponent
(
"
Markdown
"
)
//
const Markdown = getComponent("Markdown")
const
Operation
=
getComponent
(
"
operation
"
,
true
)
if
(
!
callbacks
)
{
...
...
@@ -10,10 +11,10 @@ export default (props) => {
}
let
callbackElements
=
callbacks
.
map
((
callback
,
callbackName
)
=>
{
return
<
div
>
return
<
div
key
=
{
callbackName
}
>
<
h2
>
{
callbackName
}
</
h2
>
{
callback
.
map
((
pathItem
,
pathItemName
)
=>
{
return
<
div
>
return
<
div
key
=
{
pathItemName
}
>
{
pathItem
.
map
((
operation
,
method
)
=>
{
return
<
Operation
operation
=
{
operation
}
...
...
@@ -38,3 +39,11 @@ export default (props) => {
{
callbackElements
}
</
div
>
}
Callbacks
.
propTypes
=
{
getComponent
:
PropTypes
.
function
.
isRequired
,
callbacks
:
PropTypes
.
array
.
isRequired
}
export
default
Callbacks
src/core/plugins/oas3/components/operation-link.jsx
浏览文件 @
b373182a
import
React
,
{
Component
}
from
"
react
"
import
PropTypes
from
"
prop-types
"
import
ImPropTypes
from
"
react-immutable-proptypes
"
export
default
class
OperationLink
extends
Component
{
class
OperationLink
extends
Component
{
render
()
{
const
{
link
,
name
}
=
this
.
props
...
...
@@ -26,3 +28,10 @@ function padString(n, string) {
.
map
((
line
,
i
)
=>
i
>
0
?
Array
(
n
+
1
).
join
(
"
"
)
+
line
:
line
)
.
join
(
"
\n
"
)
}
OperationLink
.
propTypes
=
{
link
:
ImPropTypes
.
orderedMap
.
isRequired
,
name
:
PropTypes
.
String
}
export
default
OperationLink
src/core/plugins/oas3/components/request-body.jsx
浏览文件 @
b373182a
import
React
from
"
react
"
import
PropTypes
from
"
prop-types
"
import
ImPropTypes
from
"
react-immutable-proptypes
"
import
{
OrderedMap
}
from
"
immutable
"
import
{
getSampleSchema
}
from
"
core/utils
"
export
default
({
requestBody
,
getComponent
,
specSelectors
,
contentType
})
=>
{
const
RequestBody
=
({
requestBody
,
getComponent
,
specSelectors
,
contentType
})
=>
{
const
Markdown
=
getComponent
(
"
Markdown
"
)
const
ModelExample
=
getComponent
(
"
modelExample
"
)
const
HighlightCode
=
getComponent
(
"
highlightCode
"
)
...
...
@@ -29,3 +31,12 @@ export default ({ requestBody, getComponent, specSelectors, contentType }) => {
/>
</
div
>
}
RequestBody
.
propTypes
=
{
requestBody
:
ImPropTypes
.
orderedMap
.
isRequired
,
getComponent
:
PropTypes
.
function
.
isRequired
,
specSelectors
:
PropTypes
.
object
.
isRequired
,
contentType
:
PropTypes
.
string
.
isRequired
}
export
default
RequestBody
src/core/plugins/oas3/wrap-components/model.jsx
浏览文件 @
b373182a
import
React
,
{
Component
,
PropTypes
}
from
"
react
"
import
React
,
{
Component
}
from
"
react
"
import
PropTypes
from
"
prop-types
"
import
{
OAS3ComponentWrapFactory
}
from
"
../helpers
"
import
{
Model
}
from
"
core/components/model
"
...
...
src/core/plugins/oas3/wrap-components/online-validator-badge.js
浏览文件 @
b373182a
import
React
from
"
react
"
import
{
OAS3ComponentWrapFactory
}
from
"
../helpers
"
// We're disabling the Online Validator Badge until the online validator
...
...
src/core/plugins/oas3/wrap-components/parameters.jsx
浏览文件 @
b373182a
import
React
,
{
Component
,
PropTypes
}
from
"
react
"
import
React
,
{
Component
}
from
"
react
"
import
PropTypes
from
"
prop-types
"
import
Im
,
{
Map
}
from
"
immutable
"
import
ImPropTypes
from
"
react-immutable-proptypes
"
import
{
OAS3ComponentWrapFactory
}
from
"
../helpers
"
const
mapRequestBody
=
(
iterable
,
fn
)
=>
iterable
.
entries
().
filter
(
Im
.
Map
.
isMap
).
map
((
val
)
=>
{
return
fn
(
val
.
get
(
0
),
val
.
get
(
1
))
})
// More readable, just iterate over maps, only
const
eachMap
=
(
iterable
,
fn
)
=>
iterable
.
valueSeq
().
filter
(
Im
.
Map
.
isMap
).
map
(
fn
)
...
...
src/core/plugins/oas3/wrap-components/try-it-out-button.jsx
浏览文件 @
b373182a
import
React
from
"
react
"
import
{
OAS3ComponentWrapFactory
}
from
"
../helpers
"
export
default
OAS3ComponentWrapFactory
(()
=>
{
...
...
src/core/plugins/spec/selectors.js
浏览文件 @
b373182a
...
...
@@ -49,8 +49,10 @@ export const spec = state => {
export
const
isOAS3
=
createSelector
(
// isOAS3 is stubbed out here to work around an issue with injecting more selectors
// in the OAS3 plugin, and to ensure that the function is always available.
// It's not perfect, but our hybrid (core+plugin code) implementation for OAS3
// needs this. //KS
spec
,
spec
=>
false
()
=>
false
)
export
const
info
=
createSelector
(
...
...
test/.eslintrc
浏览文件 @
b373182a
env:
mocha: true
rules:
"react/prop-types": 1 # bah humbug
"no-unused-vars": 1 # unused vars in tests can be useful for indicating a full signature
test/core/system/system.js
浏览文件 @
b373182a
...
...
@@ -326,7 +326,7 @@ describe("bound system", function(){
})
describe
(
'
wrapSelectors
'
,
()
=>
{
describe
(
"
wrapSelectors
"
,
()
=>
{
it
(
"
should wrap a selector and provide a reference to the original
"
,
function
(){
// Given
...
...
@@ -427,7 +427,7 @@ describe("bound system", function(){
wrapSelectors
:
{
wow
:
(
ori
,
system
)
=>
(
dogeState
)
=>
{
// Then
expect
(
dogeState
.
toJS
().
abc
).
toEqual
(
'
123
'
)
expect
(
dogeState
.
toJS
().
abc
).
toEqual
(
"
123
"
)
done
()
return
ori
()
+
"
wrapper
"
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录