Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Sunny_yiyi
Swagger Ui
提交
99600df0
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,发现更多精彩内容 >>
提交
99600df0
编写于
6月 16, 2017
作者:
S
shockey
提交者:
GitHub
6月 16, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into fix-model-markdown
上级
ce16666b
1cab4984
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
69 addition
and
36 deletion
+69
-36
dist/swagger-ui-bundle.js
dist/swagger-ui-bundle.js
+19
-19
dist/swagger-ui-bundle.js.map
dist/swagger-ui-bundle.js.map
+1
-1
dist/swagger-ui.js
dist/swagger-ui.js
+5
-5
dist/swagger-ui.js.map
dist/swagger-ui.js.map
+1
-1
src/core/components/curl.jsx
src/core/components/curl.jsx
+1
-1
src/core/components/model.jsx
src/core/components/model.jsx
+1
-1
src/core/components/response.jsx
src/core/components/response.jsx
+1
-1
src/core/curlify.js
src/core/curlify.js
+8
-4
src/core/utils.js
src/core/utils.js
+4
-0
src/core/window.js
src/core/window.js
+2
-1
test/core/curlify.js
test/core/curlify.js
+26
-2
未找到文件。
dist/swagger-ui-bundle.js
浏览文件 @
99600df0
此差异已折叠。
点击以展开。
dist/swagger-ui-bundle.js.map
浏览文件 @
99600df0
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AA2TA;;;;;;AAoIA;AAi7FA;AAmtCA;AAi0IA;AA0oJA;AAgiGA;AA0/FA;AAqkFA;AAqjFA;AAk9CA;AA+jDA;AAwrCA;AA0gFA;;;;;AA+zBA;AAsyJA;;;;;;;;;;;;;;AA64EA;AA4mIA;AAquJA;AA2qHA;AA2mGA;AAiiEA;AAq4DA;AAg3DA;AA8NA;;;;;;AAw8FA;AA07FA;;;;;AAi8CA;AAgsFA;AAs2CA;AA+kCA;AAg8CA;AAg/EA;AAu/BA;AAk0FA;;;;;;;;;AAomDA;AA2zIA;AAu7FA;AAmrFA;AA20EA","sourceRoot":""}
{"version":3,"file":"swagger-ui-bundle.js","sources":["webpack:///swagger-ui-bundle.js"],"mappings":"AAAA;AAu/FA;AA6+FA;;;;;;;;;;;;;;;;;;;;;;;;;;AA2TA;;;;;;AAoIA;AAi7FA;AAmtCA;AAi0IA;AAioJA;AAswFA;AAisGA;AA0lFA;AA4nFA;AA+9CA;AA+gDA;AAwrCA;AA60EA;;;;;AA2oCA;AAsyJA;;;;;;;;;;;;;;AA64EA;AA4mIA;AAquJA;AA2qHA;AA2mGA;AAiiEA;AAq4DA;AAg3DA;AA8NA;;;;;;AAw8FA;AA07FA;;;;;AAi8CA;AAgsFA;AAs2CA;AAilCA;AA+7CA;AAk/EA;AAi7BA;AAg4FA;;;;;;;;;AA+mDA;AA2zIA;AAu7FA;AAmrFA;AAu0EA","sourceRoot":""}
\ No newline at end of file
\ No newline at end of file
dist/swagger-ui.js
浏览文件 @
99600df0
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
dist/swagger-ui.js.map
浏览文件 @
99600df0
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AA4yCA;AAoyHA;AAmyHA;AAukGA;AA+9BA;AA2jCA;AA0iCA;AAy4BA","sourceRoot":""}
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;;;;;;AAizCA;AAoyHA;AAmyHA;AAukGA;AA+9BA;AA8jCA;AAyiCA;AA44BA","sourceRoot":""}
\ No newline at end of file
\ No newline at end of file
src/core/components/curl.jsx
浏览文件 @
99600df0
...
@@ -19,7 +19,7 @@ export default class Curl extends React.Component {
...
@@ -19,7 +19,7 @@ export default class Curl extends React.Component {
<
div
>
<
div
>
<
h4
>
Curl
</
h4
>
<
h4
>
Curl
</
h4
>
<
div
className
=
"copy-paste"
>
<
div
className
=
"copy-paste"
>
<
textarea
onFocus
=
{
this
.
handleFocus
}
className
=
"curl"
style
=
{
{
whiteSpace
:
"
normal
"
}
}
value
=
{
curl
}
></
textarea
>
<
textarea
onFocus
=
{
this
.
handleFocus
}
readOnly
=
"true"
className
=
"curl"
style
=
{
{
whiteSpace
:
"
normal
"
}
}
value
=
{
curl
}
></
textarea
>
</
div
>
</
div
>
</
div
>
</
div
>
)
)
...
...
src/core/components/model.jsx
浏览文件 @
99600df0
...
@@ -246,7 +246,7 @@ class Model extends Component {
...
@@ -246,7 +246,7 @@ class Model extends Component {
switch
(
type
)
{
switch
(
type
)
{
case
"
object
"
:
case
"
object
"
:
return
<
ObjectModel
className
=
"object"
{
...
this
.
props
}
schema
=
{
modelSchema
}
return
<
ObjectModel
className
=
"object"
{
...
this
.
props
}
schema
=
{
modelSchema
}
name
=
{
modelName
||
n
ame
}
name
=
{
name
||
modelN
ame
}
isRef
=
{
isRef
!==
undefined
?
isRef
:
!!
$$ref
}
/>
isRef
=
{
isRef
!==
undefined
?
isRef
:
!!
$$ref
}
/>
case
"
array
"
:
case
"
array
"
:
return
<
ArrayModel
className
=
"array"
{
...
this
.
props
}
schema
=
{
modelSchema
}
required
=
{
required
}
/>
return
<
ArrayModel
className
=
"array"
{
...
this
.
props
}
schema
=
{
modelSchema
}
required
=
{
required
}
/>
...
...
src/core/components/response.jsx
浏览文件 @
99600df0
...
@@ -8,7 +8,7 @@ const getExampleComponent = ( sampleResponse, examples, HighlightCode ) => {
...
@@ -8,7 +8,7 @@ const getExampleComponent = ( sampleResponse, examples, HighlightCode ) => {
let
exampleValue
let
exampleValue
try
{
try
{
exampleValue
=
example
&&
example
.
toJS
?
example
.
toJS
()
:
example
exampleValue
=
example
&&
example
.
toJS
?
example
.
toJS
()
:
example
exampleValue
=
JSON
.
stringify
(
exampleValue
)
exampleValue
=
JSON
.
stringify
(
exampleValue
,
null
,
2
)
}
}
catch
(
e
)
{
catch
(
e
)
{
exampleValue
=
String
(
example
)
exampleValue
=
String
(
example
)
...
...
src/core/curlify.js
浏览文件 @
99600df0
import
win
from
"
./window
"
export
default
function
curl
(
request
){
export
default
function
curl
(
request
){
let
curlified
=
[]
let
curlified
=
[]
let
type
=
""
let
type
=
""
...
@@ -18,11 +20,13 @@ export default function curl( request ){
...
@@ -18,11 +20,13 @@ export default function curl( request ){
if
(
request
.
get
(
"
body
"
)
){
if
(
request
.
get
(
"
body
"
)
){
if
(
type
===
"
multipart/form-data
"
&&
request
.
get
(
"
method
"
)
===
"
POST
"
)
{
if
(
type
===
"
multipart/form-data
"
&&
request
.
get
(
"
method
"
)
===
"
POST
"
)
{
let
formDataBody
=
request
.
get
(
"
body
"
).
split
(
"
&
"
)
for
(
let
[
k
,
v
]
of
request
.
get
(
"
body
"
).
values
())
{
for
(
var
data
in
formDataBody
)
{
curlified
.
push
(
"
-F
"
)
curlified
.
push
(
"
-F
"
)
curlified
.
push
(
formDataBody
[
data
])
if
(
v
instanceof
win
.
File
)
{
curlified
.
push
(
`"
${
k
}
=@
${
v
.
name
}
;type=
${
v
.
type
}
"`
)
}
else
{
curlified
.
push
(
`"
${
k
}
=
${
v
}
"`
)
}
}
}
}
else
{
}
else
{
curlified
.
push
(
"
-d
"
)
curlified
.
push
(
"
-d
"
)
...
...
src/core/utils.js
浏览文件 @
99600df0
...
@@ -7,6 +7,7 @@ import _memoize from "lodash/memoize"
...
@@ -7,6 +7,7 @@ import _memoize from "lodash/memoize"
import
some
from
"
lodash/some
"
import
some
from
"
lodash/some
"
import
eq
from
"
lodash/eq
"
import
eq
from
"
lodash/eq
"
import
{
memoizedSampleFromSchema
,
memoizedCreateXMLExample
}
from
"
core/plugins/samples/fn
"
import
{
memoizedSampleFromSchema
,
memoizedCreateXMLExample
}
from
"
core/plugins/samples/fn
"
import
win
from
"
./window
"
const
DEFAULT_REPONSE_KEY
=
"
default
"
const
DEFAULT_REPONSE_KEY
=
"
default
"
...
@@ -34,6 +35,9 @@ export function fromJSOrdered (js) {
...
@@ -34,6 +35,9 @@ export function fromJSOrdered (js) {
if
(
isImmutable
(
js
))
if
(
isImmutable
(
js
))
return
js
// Can't do much here
return
js
// Can't do much here
if
(
js
instanceof
win
.
File
)
return
js
return
!
isObject
(
js
)
?
js
:
return
!
isObject
(
js
)
?
js
:
Array
.
isArray
(
js
)
?
Array
.
isArray
(
js
)
?
Im
.
Seq
(
js
).
map
(
fromJSOrdered
).
toList
()
:
Im
.
Seq
(
js
).
map
(
fromJSOrdered
).
toList
()
:
...
...
src/core/window.js
浏览文件 @
99600df0
...
@@ -3,7 +3,8 @@ function makeWindow() {
...
@@ -3,7 +3,8 @@ function makeWindow() {
location
:
{},
location
:
{},
history
:
{},
history
:
{},
open
:
()
=>
{},
open
:
()
=>
{},
close
:
()
=>
{}
close
:
()
=>
{},
File
:
function
()
{}
}
}
if
(
typeof
window
===
"
undefined
"
)
{
if
(
typeof
window
===
"
undefined
"
)
{
...
...
test/core/curlify.js
浏览文件 @
99600df0
import
expect
from
"
expect
"
import
expect
from
"
expect
"
import
Im
from
"
immutable
"
import
Im
from
"
immutable
"
import
curl
from
"
core/curlify
"
import
curl
from
"
core/curlify
"
import
win
from
"
core/window
"
describe
(
"
curlify
"
,
function
()
{
describe
(
"
curlify
"
,
function
()
{
...
@@ -131,12 +132,35 @@ describe("curlify", function() {
...
@@ -131,12 +132,35 @@ describe("curlify", function() {
url
:
"
http://example.com
"
,
url
:
"
http://example.com
"
,
method
:
"
POST
"
,
method
:
"
POST
"
,
headers
:
{
"
content-type
"
:
"
multipart/form-data
"
},
headers
:
{
"
content-type
"
:
"
multipart/form-data
"
},
body
:
"
id=123&name=Sahar
"
body
:
[
[
"
id
"
,
"
123
"
],
[
"
name
"
,
"
Sahar
"
]
]
}
}
let
curlified
=
curl
(
Im
.
fromJS
(
req
))
let
curlified
=
curl
(
Im
.
fromJS
(
req
))
expect
(
curlified
).
toEqual
(
"
curl -X POST
\"
http://example.com
\"
-H
\"
content-type: multipart/form-data
\"
-F id=123 -F name=Sahar
"
)
expect
(
curlified
).
toEqual
(
"
curl -X POST
\"
http://example.com
\"
-H
\"
content-type: multipart/form-data
\"
-F
\"
id=123
\"
-F
\"
name=Sahar
\"
"
)
})
it
(
"
should print a curl with formData and file
"
,
function
()
{
var
file
=
new
win
.
File
()
file
.
name
=
"
file.txt
"
file
.
type
=
"
text/plain
"
var
req
=
{
url
:
"
http://example.com
"
,
method
:
"
POST
"
,
headers
:
{
"
content-type
"
:
"
multipart/form-data
"
},
body
:
[
[
"
id
"
,
"
123
"
],
[
"
file
"
,
file
]
]
}
let
curlified
=
curl
(
Im
.
fromJS
(
req
))
expect
(
curlified
).
toEqual
(
"
curl -X POST
\"
http://example.com
\"
-H
\"
content-type: multipart/form-data
\"
-F
\"
id=123
\"
-F
\"
file=@file.txt;type=text/plain
\"
"
)
})
})
it
(
"
prints a curl post statement from an object
"
,
function
()
{
it
(
"
prints a curl post statement from an object
"
,
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录