mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 07:16:40 +00:00
Initial commit
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SwaggerRails</title>
|
||||
<%= stylesheet_link_tag "swagger_rails/application", media: "all" %>
|
||||
<%= javascript_include_tag "swagger_rails/application" %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<%= yield %>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
10
app/views/layouts/swagger_rails/application.html.haml
Normal file
10
app/views/layouts/swagger_rails/application.html.haml
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
%html
|
||||
%head
|
||||
%title SwaggerRails
|
||||
%link{ href: '//fonts.googleapis.com/css?family=Droid+Sans:400,700', rel: 'stylesheet', type: 'text/css' }
|
||||
=stylesheet_link_tag "swagger_rails/application"
|
||||
=javascript_include_tag "swagger_rails/application"
|
||||
=csrf_meta_tags
|
||||
%body.swagger-section
|
||||
=yield
|
||||
30
app/views/swagger_rails/swagger_ui/show.html.haml
Normal file
30
app/views/swagger_rails/swagger_ui/show.html.haml
Normal file
@@ -0,0 +1,30 @@
|
||||
#header
|
||||
.swagger-ui-wrap
|
||||
%a#logo{ href: 'http://swagger.io'} swagger
|
||||
%form#api_selector
|
||||
.input
|
||||
%input#input_baseUrl{ name: 'baseUrl' }
|
||||
.input
|
||||
%input#input_apiKey{ name: 'apiKey' }
|
||||
.input
|
||||
%a#input_apiKey{ name: 'apiKey' }
|
||||
|
||||
#message-bar.swagger-ui-wrap
|
||||
|
||||
#swagger-ui-container.swagger-ui-wrap{ data: { discovery_url: @discovery_url } }
|
||||
|
||||
:coffeescript
|
||||
window.swaggerUi = new SwaggerUi(
|
||||
url: $('#swagger-ui-container').data('discoveryUrl')
|
||||
dom_id: 'swagger-ui-container'
|
||||
onComplete: (swaggerApi, swaggerUi) ->
|
||||
log('Loaded SwaggerUi')
|
||||
$('pre code').each (i, e) ->
|
||||
hljs.highlighBlock(e)
|
||||
onFailure: (data) ->
|
||||
log('Unable to load Swagger UI')
|
||||
docExpansion: 'none'
|
||||
sorter: 'alpha'
|
||||
)
|
||||
|
||||
window.swaggerUi.load()
|
||||
Reference in New Issue
Block a user