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
e980cca6
Commit
e980cca6
authored
Jul 11, 2013
by
Tony Tam
Browse files
added api info
parent
187d2450
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
dist/css/screen.css
View file @
e980cca6
...
...
@@ -1756,4 +1756,32 @@ pre code {
.message-fail
{
color
:
#cc0000
;
}
.info_title
{
padding-left
:
25px
;
padding-bottom
:
10px
;
font-weight
:
bold
;
font-size
:
25px
;
}
.info_description
{
padding-left
:
25px
;
padding-bottom
:
10px
;
font-size
:
15px
;
}
.info_tos
{
padding-left
:
25px
;
padding-bottom
:
5px
;
}
.info_license
{
padding-left
:
25px
;
padding-bottom
:
5px
;
}
.info_contact
{
padding-left
:
25px
;
padding-bottom
:
5px
;
}
\ No newline at end of file
dist/index.html
View file @
e980cca6
...
...
@@ -20,9 +20,8 @@
<script
type=
"text/javascript"
>
$
(
function
()
{
window
.
swaggerUi
=
new
SwaggerUi
({
url
:
"
http://petstore.swagger.wordnik.com/api/api-docs.json
"
,
dom_id
:
"
swagger-ui-container
"
,
supportHeaderParams
:
false
,
url
:
"
http://localhost:8002/api/api-docs
"
,
dom_id
:
"
swagger-ui-container
"
,
supportedSubmitMethods
:
[
'
get
'
,
'
post
'
,
'
put
'
,
'
delete
'
],
onComplete
:
function
(
swaggerApi
,
swaggerUi
){
if
(
console
)
{
...
...
dist/lib/swagger.js
View file @
e980cca6
...
...
@@ -15,6 +15,8 @@
SwaggerApi
.
prototype
.
authorizationScheme
=
null
;
SwaggerApi
.
prototype
.
info
=
null
;
function
SwaggerApi
(
url
,
options
)
{
if
(
options
==
null
)
{
options
=
{};
...
...
@@ -71,6 +73,9 @@
}
_this
.
apis
=
{};
_this
.
apisArray
=
[];
if
(
response
.
info
!=
null
)
{
_this
.
info
=
response
.
info
;
}
isApi
=
false
;
_ref
=
response
.
apis
;
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
...
...
dist/swagger-ui.js
View file @
e980cca6
...
...
@@ -246,6 +246,99 @@ templates['main'] = template(function (Handlebars,depth0,helpers,partials,data)
function
program1
(
depth0
,
data
)
{
var
buffer
=
""
,
stack1
,
stack2
;
buffer
+=
"
\n
<div class=
\"
info_title
\"
>
"
;
foundHelper
=
helpers
.
info
;
stack1
=
foundHelper
||
depth0
.
info
;
stack1
=
(
stack1
===
null
||
stack1
===
undefined
||
stack1
===
false
?
stack1
:
stack1
.
title
);
if
(
typeof
stack1
===
functionType
)
{
stack1
=
stack1
.
call
(
depth0
,
{
hash
:
{}
});
}
else
if
(
stack1
===
undef
)
{
stack1
=
helperMissing
.
call
(
depth0
,
"
info.title
"
,
{
hash
:
{}
});
}
buffer
+=
escapeExpression
(
stack1
)
+
"
</div>
\n
<div class=
\"
info_description
\"
>
"
;
foundHelper
=
helpers
.
info
;
stack1
=
foundHelper
||
depth0
.
info
;
stack1
=
(
stack1
===
null
||
stack1
===
undefined
||
stack1
===
false
?
stack1
:
stack1
.
description
);
if
(
typeof
stack1
===
functionType
)
{
stack1
=
stack1
.
call
(
depth0
,
{
hash
:
{}
});
}
else
if
(
stack1
===
undef
)
{
stack1
=
helperMissing
.
call
(
depth0
,
"
info.description
"
,
{
hash
:
{}
});
}
if
(
stack1
||
stack1
===
0
)
{
buffer
+=
stack1
;
}
buffer
+=
"
</div>
\n
"
;
foundHelper
=
helpers
.
info
;
stack1
=
foundHelper
||
depth0
.
info
;
stack1
=
(
stack1
===
null
||
stack1
===
undefined
||
stack1
===
false
?
stack1
:
stack1
.
termsOfServiceUrl
);
stack2
=
helpers
[
'
if
'
];
tmp1
=
self
.
program
(
2
,
program2
,
data
);
tmp1
.
hash
=
{};
tmp1
.
fn
=
tmp1
;
tmp1
.
inverse
=
self
.
noop
;
stack1
=
stack2
.
call
(
depth0
,
stack1
,
tmp1
);
if
(
stack1
||
stack1
===
0
)
{
buffer
+=
stack1
;
}
buffer
+=
"
\n
"
;
foundHelper
=
helpers
.
info
;
stack1
=
foundHelper
||
depth0
.
info
;
stack1
=
(
stack1
===
null
||
stack1
===
undefined
||
stack1
===
false
?
stack1
:
stack1
.
contact
);
stack2
=
helpers
[
'
if
'
];
tmp1
=
self
.
program
(
4
,
program4
,
data
);
tmp1
.
hash
=
{};
tmp1
.
fn
=
tmp1
;
tmp1
.
inverse
=
self
.
noop
;
stack1
=
stack2
.
call
(
depth0
,
stack1
,
tmp1
);
if
(
stack1
||
stack1
===
0
)
{
buffer
+=
stack1
;
}
buffer
+=
"
\n
"
;
foundHelper
=
helpers
.
info
;
stack1
=
foundHelper
||
depth0
.
info
;
stack1
=
(
stack1
===
null
||
stack1
===
undefined
||
stack1
===
false
?
stack1
:
stack1
.
license
);
stack2
=
helpers
[
'
if
'
];
tmp1
=
self
.
program
(
6
,
program6
,
data
);
tmp1
.
hash
=
{};
tmp1
.
fn
=
tmp1
;
tmp1
.
inverse
=
self
.
noop
;
stack1
=
stack2
.
call
(
depth0
,
stack1
,
tmp1
);
if
(
stack1
||
stack1
===
0
)
{
buffer
+=
stack1
;
}
buffer
+=
"
\n
"
;
return
buffer
;}
function
program2
(
depth0
,
data
)
{
var
buffer
=
""
,
stack1
;
buffer
+=
"
<div class=
\"
info_tos
\"
><a href=
\"
"
;
foundHelper
=
helpers
.
info
;
stack1
=
foundHelper
||
depth0
.
info
;
stack1
=
(
stack1
===
null
||
stack1
===
undefined
||
stack1
===
false
?
stack1
:
stack1
.
termsOfServiceUrl
);
if
(
typeof
stack1
===
functionType
)
{
stack1
=
stack1
.
call
(
depth0
,
{
hash
:
{}
});
}
else
if
(
stack1
===
undef
)
{
stack1
=
helperMissing
.
call
(
depth0
,
"
info.termsOfServiceUrl
"
,
{
hash
:
{}
});
}
buffer
+=
escapeExpression
(
stack1
)
+
"
\"
>Terms of service</a></div>
"
;
return
buffer
;}
function
program4
(
depth0
,
data
)
{
var
buffer
=
""
,
stack1
;
buffer
+=
"
<div class='info_contact'><a href=
\"
mailto:
"
;
foundHelper
=
helpers
.
info
;
stack1
=
foundHelper
||
depth0
.
info
;
stack1
=
(
stack1
===
null
||
stack1
===
undefined
||
stack1
===
false
?
stack1
:
stack1
.
contact
);
if
(
typeof
stack1
===
functionType
)
{
stack1
=
stack1
.
call
(
depth0
,
{
hash
:
{}
});
}
else
if
(
stack1
===
undef
)
{
stack1
=
helperMissing
.
call
(
depth0
,
"
info.contact
"
,
{
hash
:
{}
});
}
buffer
+=
escapeExpression
(
stack1
)
+
"
\"
>Contact the developer</a></div>
"
;
return
buffer
;}
function
program6
(
depth0
,
data
)
{
var
buffer
=
""
,
stack1
;
buffer
+=
"
<div class='info_license'><a href='
"
;
foundHelper
=
helpers
.
info
;
stack1
=
foundHelper
||
depth0
.
info
;
stack1
=
(
stack1
===
null
||
stack1
===
undefined
||
stack1
===
false
?
stack1
:
stack1
.
licenseUrl
);
if
(
typeof
stack1
===
functionType
)
{
stack1
=
stack1
.
call
(
depth0
,
{
hash
:
{}
});
}
else
if
(
stack1
===
undef
)
{
stack1
=
helperMissing
.
call
(
depth0
,
"
info.licenseUrl
"
,
{
hash
:
{}
});
}
buffer
+=
escapeExpression
(
stack1
)
+
"
'>
"
;
foundHelper
=
helpers
.
info
;
stack1
=
foundHelper
||
depth0
.
info
;
stack1
=
(
stack1
===
null
||
stack1
===
undefined
||
stack1
===
false
?
stack1
:
stack1
.
license
);
if
(
typeof
stack1
===
functionType
)
{
stack1
=
stack1
.
call
(
depth0
,
{
hash
:
{}
});
}
else
if
(
stack1
===
undef
)
{
stack1
=
helperMissing
.
call
(
depth0
,
"
info.license
"
,
{
hash
:
{}
});
}
buffer
+=
escapeExpression
(
stack1
)
+
"
</a></div>
"
;
return
buffer
;}
function
program8
(
depth0
,
data
)
{
var
buffer
=
""
,
stack1
;
buffer
+=
"
\n
, <span style=
\"
font-variant: small-caps
\"
>api version</span>:
"
;
foundHelper
=
helpers
.
apiVersion
;
...
...
@@ -255,7 +348,17 @@ function program1(depth0,data) {
buffer
+=
escapeExpression
(
stack1
)
+
"
\n
"
;
return
buffer
;}
buffer
+=
"
\n
<div class='container' id='resources_container'>
\n
<ul id='resources'>
\n
</ul>
\n\n
<div class=
\"
footer
\"
>
\n
<br>
\n
<br>
\n
<h4 style=
\"
color: #999
\"
>[ <span style=
\"
font-variant: small-caps
\"
>base url</span>:
"
;
buffer
+=
"
<div class='info' id='api_info'>
\n
"
;
foundHelper
=
helpers
.
info
;
stack1
=
foundHelper
||
depth0
.
info
;
stack2
=
helpers
[
'
if
'
];
tmp1
=
self
.
program
(
1
,
program1
,
data
);
tmp1
.
hash
=
{};
tmp1
.
fn
=
tmp1
;
tmp1
.
inverse
=
self
.
noop
;
stack1
=
stack2
.
call
(
depth0
,
stack1
,
tmp1
);
if
(
stack1
||
stack1
===
0
)
{
buffer
+=
stack1
;
}
buffer
+=
"
\n
</div>
\n
<div class='container' id='resources_container'>
\n
<ul id='resources'>
\n
</ul>
\n\n
<div class=
\"
footer
\"
>
\n
<br>
\n
<br>
\n
<h4 style=
\"
color: #999
\"
>[ <span style=
\"
font-variant: small-caps
\"
>base url</span>:
"
;
foundHelper
=
helpers
.
basePath
;
stack1
=
foundHelper
||
depth0
.
basePath
;
if
(
typeof
stack1
===
functionType
)
{
stack1
=
stack1
.
call
(
depth0
,
{
hash
:
{}
});
}
...
...
@@ -264,7 +367,7 @@ function program1(depth0,data) {
foundHelper
=
helpers
.
apiVersion
;
stack1
=
foundHelper
||
depth0
.
apiVersion
;
stack2
=
helpers
[
'
if
'
];
tmp1
=
self
.
program
(
1
,
program
1
,
data
);
tmp1
=
self
.
program
(
8
,
program
8
,
data
);
tmp1
.
hash
=
{};
tmp1
.
fn
=
tmp1
;
tmp1
.
inverse
=
self
.
noop
;
...
...
@@ -1402,6 +1505,8 @@ templates['status_code'] = template(function (Handlebars,depth0,helpers,partials
SwaggerUi
.
prototype
.
render
=
function
()
{
var
_this
=
this
;
this
.
showMessage
(
'
Finished Loading Resource Information. Rendering Swagger UI...
'
);
console
.
log
(
"
here it comes!
"
);
console
.
log
(
this
.
api
);
this
.
mainView
=
new
MainView
({
model
:
this
.
api
,
el
:
$
(
'
#
'
+
this
.
dom_id
)
...
...
dist/swagger-ui.min.js
View file @
e980cca6
This diff is collapsed.
Click to expand it.
lib/swagger.js
View file @
e980cca6
...
...
@@ -15,6 +15,8 @@
SwaggerApi
.
prototype
.
authorizationScheme
=
null
;
SwaggerApi
.
prototype
.
info
=
null
;
function
SwaggerApi
(
url
,
options
)
{
if
(
options
==
null
)
{
options
=
{};
...
...
@@ -71,6 +73,9 @@
}
_this
.
apis
=
{};
_this
.
apisArray
=
[];
if
(
response
.
info
!=
null
)
{
_this
.
info
=
response
.
info
;
}
isApi
=
false
;
_ref
=
response
.
apis
;
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
...
...
src/main/coffeescript/SwaggerUi.coffee
View file @
e980cca6
...
...
@@ -50,6 +50,8 @@ class SwaggerUi extends Backbone.Router
# so it gets called when SwaggerApi completes loading
render
:
()
->
@
showMessage
(
'Finished Loading Resource Information. Rendering Swagger UI...'
)
console
.
log
"here it comes!"
console
.
log
@
api
@
mainView
=
new
MainView
({
model
:
@
api
,
el
:
$
(
'#'
+
@
dom_id
)}).
render
()
@
showMessage
()
switch
@
options
.
docExpansion
...
...
src/main/html/css/screen.css
View file @
e980cca6
...
...
@@ -1756,4 +1756,32 @@ pre code {
.message-fail
{
color
:
#cc0000
;
}
.info_title
{
padding-left
:
25px
;
padding-bottom
:
10px
;
font-weight
:
bold
;
font-size
:
25px
;
}
.info_description
{
padding-left
:
25px
;
padding-bottom
:
10px
;
font-size
:
15px
;
}
.info_tos
{
padding-left
:
25px
;
padding-bottom
:
5px
;
}
.info_license
{
padding-left
:
25px
;
padding-bottom
:
5px
;
}
.info_contact
{
padding-left
:
25px
;
padding-bottom
:
5px
;
}
\ No newline at end of file
src/main/html/index.html
View file @
e980cca6
...
...
@@ -20,9 +20,8 @@
<script
type=
"text/javascript"
>
$
(
function
()
{
window
.
swaggerUi
=
new
SwaggerUi
({
url
:
"
http://petstore.swagger.wordnik.com/api/api-docs.json
"
,
dom_id
:
"
swagger-ui-container
"
,
supportHeaderParams
:
false
,
url
:
"
http://localhost:8002/api/api-docs
"
,
dom_id
:
"
swagger-ui-container
"
,
supportedSubmitMethods
:
[
'
get
'
,
'
post
'
,
'
put
'
,
'
delete
'
],
onComplete
:
function
(
swaggerApi
,
swaggerUi
){
if
(
console
)
{
...
...
src/main/template/main.handlebars
View file @
e980cca6
<div
class=
'info'
id=
'api_info'
>
{{#if
info
}}
<div
class=
"info_title"
>
{{
info
.
title
}}
</div>
<div
class=
"info_description"
>
{{{
info
.
description
}}}
</div>
{{#if
info
.
termsOfServiceUrl
}}
<div
class=
"info_tos"
><a
href=
"
{{
info
.
termsOfServiceUrl
}}
"
>
Terms of service
</a></div>
{{/if}}
{{#if
info
.
contact
}}
<div
class=
'info_contact'
><a
href=
"mailto:
{{
info
.
contact
}}
"
>
Contact the developer
</a></div>
{{/if}}
{{#if
info
.
license
}}
<div
class=
'info_license'
><a
href=
'
{{
info
.
licenseUrl
}}
'
>
{{
info
.
license
}}
</a></div>
{{/if}}
{{/if}}
</div>
<div
class=
'container'
id=
'resources_container'
>
<ul
id=
'resources'
>
</ul>
...
...
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