Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ihor Kaharlichenko
swagger-ui-oms
Commits
085cc05c
Commit
085cc05c
authored
Aug 19, 2013
by
Tony Tam
Browse files
fixed responseMessages issue per #267
parent
888db09f
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
dist/lib/swagger.js
View file @
085cc05c
...
...
@@ -669,7 +669,7 @@
};
SwaggerOperation
.
prototype
[
"
do
"
]
=
function
(
args
,
opts
,
callback
,
error
)
{
var
key
,
param
,
params
,
possibleParams
,
req
,
requestContentType
,
responseContentType
,
value
;
var
key
,
param
,
params
,
possibleParams
,
req
,
requestContentType
,
responseContentType
,
value
,
_i
,
_len
,
_ref
;
if
(
args
==
null
)
{
args
=
{};
}
...
...
@@ -705,20 +705,30 @@
};
}
params
=
{};
params
.
headers
=
[];
if
(
args
.
headers
!=
null
)
{
params
.
headers
=
args
.
headers
;
delete
args
.
headers
;
}
_ref
=
this
.
parameters
;
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
param
=
_ref
[
_i
];
if
(
param
.
paramType
===
"
header
"
)
{
if
(
args
[
param
.
name
])
{
params
.
headers
[
param
.
name
]
=
args
[
param
.
name
];
}
}
}
if
(
args
.
body
!=
null
)
{
params
.
body
=
args
.
body
;
delete
args
.
body
;
}
possibleParams
=
(
function
()
{
var
_
i
,
_len
,
_ref
,
_results
;
_ref
=
this
.
parameters
;
var
_
j
,
_len
1
,
_ref
1
,
_results
;
_ref
1
=
this
.
parameters
;
_results
=
[];
for
(
_
i
=
0
,
_len
=
_ref
.
length
;
_
i
<
_len
;
_
i
++
)
{
param
=
_ref
[
_
i
];
for
(
_
j
=
0
,
_len
1
=
_ref
1
.
length
;
_
j
<
_len
1
;
_
j
++
)
{
param
=
_ref
1
[
_
j
];
if
(
param
.
paramType
===
"
form
"
||
param
.
paramType
.
toLowerCase
()
===
"
file
"
)
{
_results
.
push
(
param
);
}
...
...
@@ -839,7 +849,7 @@
SwaggerRequest
=
(
function
()
{
function
SwaggerRequest
(
type
,
url
,
params
,
opts
,
successCallback
,
errorCallback
,
operation
,
execution
)
{
var
body
,
e
,
fields
,
headers
,
key
,
myHeaders
,
obj
,
param
,
parent
,
possibleParams
,
requestContentType
,
responseContentType
,
urlEncoded
,
value
,
values
,
var
body
,
e
,
fields
,
headers
,
key
,
myHeaders
,
name
,
obj
,
param
,
parent
,
possibleParams
,
requestContentType
,
responseContentType
,
urlEncoded
,
value
,
values
,
_this
=
this
;
this
.
type
=
type
;
this
.
url
=
url
;
...
...
@@ -962,6 +972,9 @@
}
body
=
urlEncoded
;
}
for
(
name
in
headers
)
{
myHeaders
[
name
]
=
headers
[
name
];
}
if
(
requestContentType
)
{
myHeaders
[
"
Content-Type
"
]
=
requestContentType
;
}
...
...
dist/swagger-ui.js
View file @
085cc05c
...
...
@@ -461,7 +461,7 @@ function program11(depth0,data) {
stack1
=
helpers
[
'
if
'
].
call
(
depth0
,
depth0
.
parameters
,
{
hash
:{},
inverse
:
self
.
noop
,
fn
:
self
.
program
(
5
,
program5
,
data
),
data
:
data
});
if
(
stack1
||
stack1
===
0
)
{
buffer
+=
stack1
;
}
buffer
+=
"
\n
"
;
stack1
=
helpers
[
'
if
'
].
call
(
depth0
,
depth0
.
errorRespons
es
,
{
hash
:{},
inverse
:
self
.
noop
,
fn
:
self
.
program
(
7
,
program7
,
data
),
data
:
data
});
stack1
=
helpers
[
'
if
'
].
call
(
depth0
,
depth0
.
responseMessag
es
,
{
hash
:{},
inverse
:
self
.
noop
,
fn
:
self
.
program
(
7
,
program7
,
data
),
data
:
data
});
if
(
stack1
||
stack1
===
0
)
{
buffer
+=
stack1
;
}
buffer
+=
"
\n
"
;
stack1
=
helpers
[
'
if
'
].
call
(
depth0
,
depth0
.
isReadOnly
,
{
hash
:{},
inverse
:
self
.
program
(
11
,
program11
,
data
),
fn
:
self
.
program
(
9
,
program9
,
data
),
data
:
data
});
...
...
@@ -1134,10 +1134,10 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
else
{
stack1
=
depth0
.
code
;
stack1
=
typeof
stack1
===
functionType
?
stack1
.
apply
(
depth0
)
:
stack1
;
}
buffer
+=
escapeExpression
(
stack1
)
+
"
</td>
\n
<td>
"
;
if
(
stack1
=
helpers
.
reason
)
{
stack1
=
stack1
.
call
(
depth0
,
{
hash
:{},
data
:
data
});
}
else
{
stack1
=
depth0
.
reason
;
stack1
=
typeof
stack1
===
functionType
?
stack1
.
apply
(
depth0
)
:
stack1
;
}
if
(
stack1
=
helpers
.
message
)
{
stack1
=
stack1
.
call
(
depth0
,
{
hash
:{},
data
:
data
});
}
else
{
stack1
=
depth0
.
message
;
stack1
=
typeof
stack1
===
functionType
?
stack1
.
apply
(
depth0
)
:
stack1
;
}
if
(
stack1
||
stack1
===
0
)
{
buffer
+=
stack1
;
}
buffer
+=
"
</td>
\n
\n
"
;
buffer
+=
"
</td>
\n
"
;
return
buffer
;
});
})();
...
...
dist/swagger-ui.min.js
View file @
085cc05c
This diff is collapsed.
Click to expand it.
lib/swagger.js
View file @
085cc05c
...
...
@@ -669,7 +669,7 @@
};
SwaggerOperation
.
prototype
[
"
do
"
]
=
function
(
args
,
opts
,
callback
,
error
)
{
var
key
,
param
,
params
,
possibleParams
,
req
,
requestContentType
,
responseContentType
,
value
;
var
key
,
param
,
params
,
possibleParams
,
req
,
requestContentType
,
responseContentType
,
value
,
_i
,
_len
,
_ref
;
if
(
args
==
null
)
{
args
=
{};
}
...
...
@@ -705,20 +705,30 @@
};
}
params
=
{};
params
.
headers
=
[];
if
(
args
.
headers
!=
null
)
{
params
.
headers
=
args
.
headers
;
delete
args
.
headers
;
}
_ref
=
this
.
parameters
;
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
param
=
_ref
[
_i
];
if
(
param
.
paramType
===
"
header
"
)
{
if
(
args
[
param
.
name
])
{
params
.
headers
[
param
.
name
]
=
args
[
param
.
name
];
}
}
}
if
(
args
.
body
!=
null
)
{
params
.
body
=
args
.
body
;
delete
args
.
body
;
}
possibleParams
=
(
function
()
{
var
_
i
,
_len
,
_ref
,
_results
;
_ref
=
this
.
parameters
;
var
_
j
,
_len
1
,
_ref
1
,
_results
;
_ref
1
=
this
.
parameters
;
_results
=
[];
for
(
_
i
=
0
,
_len
=
_ref
.
length
;
_
i
<
_len
;
_
i
++
)
{
param
=
_ref
[
_
i
];
for
(
_
j
=
0
,
_len
1
=
_ref
1
.
length
;
_
j
<
_len
1
;
_
j
++
)
{
param
=
_ref
1
[
_
j
];
if
(
param
.
paramType
===
"
form
"
||
param
.
paramType
.
toLowerCase
()
===
"
file
"
)
{
_results
.
push
(
param
);
}
...
...
@@ -839,7 +849,7 @@
SwaggerRequest
=
(
function
()
{
function
SwaggerRequest
(
type
,
url
,
params
,
opts
,
successCallback
,
errorCallback
,
operation
,
execution
)
{
var
body
,
e
,
fields
,
headers
,
key
,
myHeaders
,
obj
,
param
,
parent
,
possibleParams
,
requestContentType
,
responseContentType
,
urlEncoded
,
value
,
values
,
var
body
,
e
,
fields
,
headers
,
key
,
myHeaders
,
name
,
obj
,
param
,
parent
,
possibleParams
,
requestContentType
,
responseContentType
,
urlEncoded
,
value
,
values
,
_this
=
this
;
this
.
type
=
type
;
this
.
url
=
url
;
...
...
@@ -962,6 +972,9 @@
}
body
=
urlEncoded
;
}
for
(
name
in
headers
)
{
myHeaders
[
name
]
=
headers
[
name
];
}
if
(
requestContentType
)
{
myHeaders
[
"
Content-Type
"
]
=
requestContentType
;
}
...
...
src/main/template/operation.handlebars
View file @
085cc05c
...
...
@@ -46,7 +46,7 @@
</tbody>
</table>
{{/if}}
{{#if
errorRespons
es
}}
{{#if
responseMessag
es
}}
<div
style=
'margin:0;padding:0;display:inline'
></div>
<h4>
Error Status Codes
</h4>
<table
class=
'fullwidth'
>
...
...
src/main/template/status_code.handlebars
View file @
085cc05c
<td
width=
'15%'
class=
'code'
>
{{
code
}}
</td>
<td>
{{{
reason
}}}
</td>
<td>
{{{
message
}}}
</td>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment