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
abc36009
Commit
abc36009
authored
Sep 24, 2013
by
Tony Tam
Browse files
Merge pull request #295 from tomrac87/hal_json
Proper formatting for "application/hal+json" Content-Type
parents
77882a0e
ff05f911
Changes
2
Hide whitespace changes
Inline
Side-by-side
dist/swagger-ui.js
View file @
abc36009
...
...
@@ -1735,7 +1735,7 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
if
(
content
===
void
0
)
{
code
=
$
(
'
<code />
'
).
text
(
"
no content
"
);
pre
=
$
(
'
<pre class="json" />
'
).
append
(
code
);
}
else
if
(
contentType
.
indexOf
(
"
application/json
"
)
===
0
)
{
}
else
if
(
contentType
.
indexOf
(
"
application/json
"
)
===
0
||
contentType
.
indexOf
(
"
application/hal+json
"
)
===
0
)
{
code
=
$
(
'
<code />
'
).
text
(
JSON
.
stringify
(
JSON
.
parse
(
content
),
null
,
2
));
pre
=
$
(
'
<pre class="json" />
'
).
append
(
code
);
}
else
if
(
contentType
.
indexOf
(
"
application/xml
"
)
===
0
)
{
...
...
src/main/coffeescript/view/OperationView.coffee
View file @
abc36009
...
...
@@ -205,7 +205,7 @@ class OperationView extends Backbone.View
if
content
==
undefined
code
=
$
(
'<code />'
).
text
(
"no content"
)
pre
=
$
(
'<pre class="json" />'
).
append
(
code
)
else
if
contentType
.
indexOf
(
"application/json"
)
==
0
else
if
contentType
.
indexOf
(
"application/json"
)
==
0
||
contentType
.
indexOf
(
"application/hal+json"
)
==
0
code
=
$
(
'<code />'
).
text
(
JSON
.
stringify
(
JSON
.
parse
(
content
),
null
,
2
))
pre
=
$
(
'<pre class="json" />'
).
append
(
code
)
else
if
contentType
.
indexOf
(
"application/xml"
)
==
0
...
...
@@ -231,4 +231,4 @@ class OperationView extends Backbone.View
toggleOperationContent
:
->
elem
=
$
(
'#'
+
Docs
.
escapeResourceName
(
@
model
.
resourceName
)
+
"_"
+
@
model
.
nickname
+
"_"
+
@
model
.
method
+
"_"
+
@
model
.
number
+
"_content"
)
if
elem
.
is
(
':visible'
)
then
Docs
.
collapseOperation
(
elem
)
else
Docs
.
expandOperation
(
elem
)
\ No newline at end of file
if
elem
.
is
(
':visible'
)
then
Docs
.
collapseOperation
(
elem
)
else
Docs
.
expandOperation
(
elem
)
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