swaggard 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -5
- data/app/assets/javascripts/swaggard/swaggard.js +1 -1
- data/app/assets/javascripts/swaggard/swagger-ui.js +338 -86
- data/app/views/swaggard/swagger/index.html.erb +2 -2
- data/config/routes.rb +2 -2
- data/lib/swaggard/configuration.rb +3 -4
- data/lib/swaggard/version.rb +1 -1
- data/spec/fixtures/api.json +1 -1
- metadata +1 -1
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
</head>
|
20
20
|
|
21
|
-
<body class='swagger-section'>
|
21
|
+
<body class='swagger-section' data-doc-path='<%= doc_path(format: :json)%>'>
|
22
22
|
<div id='header'>
|
23
23
|
<div class='swagger-ui-wrap'>
|
24
24
|
<a id='logo' href='http://swagger.io'>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
<%= form_tag '', id: :api_selector do %>
|
29
29
|
|
30
30
|
<div>
|
31
|
-
<div class='input'><input placeholder='http://example.com/
|
31
|
+
<div class='input'><input placeholder='http://example.com/api_docs/swagger.json' id='input_baseUrl' name='baseUrl' type='text'/></div>
|
32
32
|
|
33
33
|
<div class='input'>
|
34
34
|
<input class='additional_parameter' data-parameter-key='<%= @authentication_key %>'
|
data/config/routes.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
Swaggard::Engine.routes.draw do
|
2
|
-
get '/(.:format)', to: 'swagger#index'
|
3
|
-
end
|
2
|
+
get '/(.:format)', to: 'swagger#index', as: :doc
|
3
|
+
end
|
@@ -4,8 +4,7 @@ module Swaggard
|
|
4
4
|
#
|
5
5
|
# Swaggard.configure do |config|
|
6
6
|
# config.api_version = '0.1'
|
7
|
-
# config.
|
8
|
-
# config.api_base_path = 'http://swagger.example.com/api'
|
7
|
+
# config.api_base_path = '/api'
|
9
8
|
# config.authentication_type = 'header'
|
10
9
|
# config.authentication_key = 'X-AUTHORIZATION'
|
11
10
|
# config.authentication_value = 'you-secret-key'
|
@@ -13,7 +12,7 @@ module Swaggard
|
|
13
12
|
# end
|
14
13
|
class Configuration
|
15
14
|
|
16
|
-
attr_accessor :
|
15
|
+
attr_accessor :controllers_path, :models_paths, :routes
|
17
16
|
|
18
17
|
attr_writer :swagger_version, :api_base_path, :api_version, :api_path, :api_formats, :title,
|
19
18
|
:description, :tos, :contact_email, :contact_name, :contact_url, :host,
|
@@ -46,7 +45,7 @@ module Swaggard
|
|
46
45
|
end
|
47
46
|
|
48
47
|
def schemes
|
49
|
-
@schemes ||= [:http]
|
48
|
+
@schemes ||= [:https, :http]
|
50
49
|
end
|
51
50
|
|
52
51
|
def title
|
data/lib/swaggard/version.rb
CHANGED
data/spec/fixtures/api.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"swagger":"2.0","info":{"description":"","version":"0.1","title":"","termsOfService":"","contact":{"name":"","email":"","url":""},"license":{"name":"","url":""}},"host":"localhost:3000","basePath":"/","tags":[{"name":"admin/pets","description":"This document describes the API for interacting with Pet resources"},{"name":"pets","description":"This document describes the API for interacting with Pet resources"}],"schemes":["http"],"paths":{"/admin/pets":{"get":{"tags":["admin/pets"],"summary":"return a list of Pets","description":"","operationId":"index","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[],"responses":{"default":{"description":"successful operation"}}}},"/pets":{"get":{"tags":["pets"],"summary":"return a list of Pets","description":"","operationId":"index","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[],"responses":{"default":{"description":"successful operation"}}}},"/pets/{id}":{"get":{"tags":["pets"],"summary":"return a Pet","description":"","operationId":"show","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[{"in":"query","name":"id","description":"The ID for the Pet","required":false,"type":"integer"},{"in":"path","name":"id","description":"Scope response to id","required":true,"type":"string"}],"responses":{"default":{"description":"successful operation"}}}}},"definitions":{}}
|
1
|
+
{"swagger":"2.0","info":{"description":"","version":"0.1","title":"","termsOfService":"","contact":{"name":"","email":"","url":""},"license":{"name":"","url":""}},"host":"localhost:3000","basePath":"/","tags":[{"name":"admin/pets","description":"This document describes the API for interacting with Pet resources"},{"name":"pets","description":"This document describes the API for interacting with Pet resources"}],"schemes":["https","http"],"paths":{"/admin/pets":{"get":{"tags":["admin/pets"],"summary":"return a list of Pets","description":"","operationId":"index","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[],"responses":{"default":{"description":"successful operation"}}}},"/pets":{"get":{"tags":["pets"],"summary":"return a list of Pets","description":"","operationId":"index","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[],"responses":{"default":{"description":"successful operation"}}}},"/pets/{id}":{"get":{"tags":["pets"],"summary":"return a Pet","description":"","operationId":"show","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[{"in":"query","name":"id","description":"The ID for the Pet","required":false,"type":"integer"},{"in":"path","name":"id","description":"Scope response to id","required":true,"type":"string"}],"responses":{"default":{"description":"successful operation"}}}}},"definitions":{}}
|