grape-swagger-rails 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +11 -1
- data/app/views/grape_swagger_rails/application/index.html.erb +25 -24
- data/grape-swagger-rails.gemspec +1 -1
- data/lib/grape-swagger-rails.rb +7 -0
- data/lib/grape-swagger-rails/version.rb +1 -1
- metadata +11 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9fdc21bd446fe7ca7b56a520e32652193698c44a
|
4
|
+
data.tar.gz: fd8a488bd660af0b095b85f691ba328619e43b56
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a081a762fb98a1d94c4887e1121519011da7ebc33d33346a1e5d8db4e6369f8c3e23986a61d9b620e91819ac57c36ccbd0f5e301471fa40fc961404050f325d7
|
7
|
+
data.tar.gz: 0753c0e6151841cdefde8420397061c602feca64126f09926c7a41b3a16d155beda87e90e11e8d41f59cd7f9ee17615fd5ed690242329207ac18e5830fd574e5
|
data/README.md
CHANGED
@@ -18,7 +18,17 @@ Or install it yourself as:
|
|
18
18
|
|
19
19
|
## Usage: add this line to your routes.rb
|
20
20
|
|
21
|
-
mount GrapeSwaggerRails::Engine => '/
|
21
|
+
mount GrapeSwaggerRails::Engine => '/swagger'
|
22
|
+
|
23
|
+
Create `./config/initializer/swagger.rg` with lines:
|
24
|
+
|
25
|
+
GrapeSwaggerRails.discoveryUrl = "/swagger_doc.json"
|
26
|
+
|
27
|
+
## Нюансы
|
28
|
+
|
29
|
+
Чтобы избежать проблемы с валидацией параметров в `POST` запросах, используе этот gem:
|
30
|
+
|
31
|
+
gem 'grape-swagger', :git=>'git://github.com/jhecking/grape-swagger.git'
|
22
32
|
|
23
33
|
## Contributing
|
24
34
|
|
@@ -7,31 +7,32 @@
|
|
7
7
|
<%= javascript_include_tag 'grape_swagger_rails/application.js' %>
|
8
8
|
<script type="text/javascript">
|
9
9
|
$(function () {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
10
|
+
window.swaggerUi = new SwaggerUi({
|
11
|
+
discoveryUrl: "<%= GrapeSwaggerRails.discoveryUrl %>",
|
12
|
+
apiKey: "<%= GrapeSwaggerRails.apiKey %>",
|
13
|
+
dom_id:"swagger-ui-container",
|
14
|
+
supportHeaderParams: true,
|
15
|
+
headers: "<%= GrapeSwaggerRails.headers.to_json %>",
|
16
|
+
supportedSubmitMethods: ['get', 'post', 'put'],
|
17
|
+
onComplete: function(swaggerApi, swaggerUi){
|
18
|
+
if(console) {
|
19
|
+
console.log("Loaded SwaggerUI")
|
20
|
+
console.log(swaggerApi);
|
21
|
+
console.log(swaggerUi);
|
22
|
+
}
|
23
|
+
$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
24
|
+
},
|
25
|
+
onFailure: function(data) {
|
26
|
+
if(console) {
|
27
|
+
console.log("Unable to Load SwaggerUI");
|
28
|
+
console.log(data);
|
29
|
+
}
|
30
|
+
},
|
31
|
+
docExpansion: "none"
|
32
|
+
});
|
32
33
|
|
33
|
-
|
34
|
-
|
34
|
+
window.swaggerUi.load();
|
35
|
+
});
|
35
36
|
|
36
37
|
</script>
|
37
38
|
</head>
|
data/grape-swagger-rails.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
|
18
18
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
19
19
|
spec.add_development_dependency 'rake'
|
20
|
-
spec.add_dependency 'railties', '
|
20
|
+
spec.add_dependency 'railties', '>= 3.2.12'
|
21
21
|
spec.add_dependency 'rubyzip', '~> 0.9.9'
|
22
22
|
spec.add_dependency 'grape-swagger', '~> 0.5.0'
|
23
23
|
end
|
data/lib/grape-swagger-rails.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-swagger-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Aleksandr B. Ivanov
|
@@ -10,12 +9,11 @@ authors:
|
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2013-
|
12
|
+
date: 2013-07-16 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: bundler
|
17
16
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
17
|
requirements:
|
20
18
|
- - ~>
|
21
19
|
- !ruby/object:Gem::Version
|
@@ -23,7 +21,6 @@ dependencies:
|
|
23
21
|
type: :development
|
24
22
|
prerelease: false
|
25
23
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
24
|
requirements:
|
28
25
|
- - ~>
|
29
26
|
- !ruby/object:Gem::Version
|
@@ -31,39 +28,34 @@ dependencies:
|
|
31
28
|
- !ruby/object:Gem::Dependency
|
32
29
|
name: rake
|
33
30
|
requirement: !ruby/object:Gem::Requirement
|
34
|
-
none: false
|
35
31
|
requirements:
|
36
|
-
- -
|
32
|
+
- - '>='
|
37
33
|
- !ruby/object:Gem::Version
|
38
34
|
version: '0'
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
37
|
version_requirements: !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
38
|
requirements:
|
44
|
-
- -
|
39
|
+
- - '>='
|
45
40
|
- !ruby/object:Gem::Version
|
46
41
|
version: '0'
|
47
42
|
- !ruby/object:Gem::Dependency
|
48
43
|
name: railties
|
49
44
|
requirement: !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
45
|
requirements:
|
52
|
-
- -
|
46
|
+
- - '>='
|
53
47
|
- !ruby/object:Gem::Version
|
54
48
|
version: 3.2.12
|
55
49
|
type: :runtime
|
56
50
|
prerelease: false
|
57
51
|
version_requirements: !ruby/object:Gem::Requirement
|
58
|
-
none: false
|
59
52
|
requirements:
|
60
|
-
- -
|
53
|
+
- - '>='
|
61
54
|
- !ruby/object:Gem::Version
|
62
55
|
version: 3.2.12
|
63
56
|
- !ruby/object:Gem::Dependency
|
64
57
|
name: rubyzip
|
65
58
|
requirement: !ruby/object:Gem::Requirement
|
66
|
-
none: false
|
67
59
|
requirements:
|
68
60
|
- - ~>
|
69
61
|
- !ruby/object:Gem::Version
|
@@ -71,7 +63,6 @@ dependencies:
|
|
71
63
|
type: :runtime
|
72
64
|
prerelease: false
|
73
65
|
version_requirements: !ruby/object:Gem::Requirement
|
74
|
-
none: false
|
75
66
|
requirements:
|
76
67
|
- - ~>
|
77
68
|
- !ruby/object:Gem::Version
|
@@ -79,7 +70,6 @@ dependencies:
|
|
79
70
|
- !ruby/object:Gem::Dependency
|
80
71
|
name: grape-swagger
|
81
72
|
requirement: !ruby/object:Gem::Requirement
|
82
|
-
none: false
|
83
73
|
requirements:
|
84
74
|
- - ~>
|
85
75
|
- !ruby/object:Gem::Version
|
@@ -87,7 +77,6 @@ dependencies:
|
|
87
77
|
type: :runtime
|
88
78
|
prerelease: false
|
89
79
|
version_requirements: !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
80
|
requirements:
|
92
81
|
- - ~>
|
93
82
|
- !ruby/object:Gem::Version
|
@@ -133,32 +122,25 @@ files:
|
|
133
122
|
homepage: ''
|
134
123
|
licenses:
|
135
124
|
- MIT
|
125
|
+
metadata: {}
|
136
126
|
post_install_message:
|
137
127
|
rdoc_options: []
|
138
128
|
require_paths:
|
139
129
|
- lib
|
140
130
|
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
-
none: false
|
142
131
|
requirements:
|
143
|
-
- -
|
132
|
+
- - '>='
|
144
133
|
- !ruby/object:Gem::Version
|
145
134
|
version: '0'
|
146
|
-
segments:
|
147
|
-
- 0
|
148
|
-
hash: 188356076380643932
|
149
135
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
-
none: false
|
151
136
|
requirements:
|
152
|
-
- -
|
137
|
+
- - '>='
|
153
138
|
- !ruby/object:Gem::Version
|
154
139
|
version: '0'
|
155
|
-
segments:
|
156
|
-
- 0
|
157
|
-
hash: 188356076380643932
|
158
140
|
requirements: []
|
159
141
|
rubyforge_project:
|
160
|
-
rubygems_version:
|
142
|
+
rubygems_version: 2.0.2
|
161
143
|
signing_key:
|
162
|
-
specification_version:
|
144
|
+
specification_version: 4
|
163
145
|
summary: grape grape-swagger swagger-ui rails integration
|
164
146
|
test_files: []
|