grape-swagger 0.25.3 → 0.26.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +11 -18
- data/.travis.yml +15 -12
- data/CHANGELOG.md +12 -0
- data/Gemfile +3 -3
- data/README.md +7 -5
- data/Rakefile +1 -1
- data/grape-swagger.gemspec +2 -1
- data/lib/grape-swagger.rb +0 -2
- data/lib/grape-swagger/doc_methods.rb +1 -0
- data/lib/grape-swagger/doc_methods/path_string.rb +3 -1
- data/lib/grape-swagger/doc_methods/version.rb +19 -0
- data/lib/grape-swagger/endpoint.rb +4 -4
- data/lib/grape-swagger/version.rb +1 -1
- data/spec/swagger_v2/api_swagger_v2_detail_spec.rb +8 -4
- data/spec/swagger_v2/namespace_tags_prefix_spec.rb +24 -2
- data/spec/swagger_v2/namespaced_api_spec.rb +10 -10
- metadata +6 -6
- data/lib/grape-swagger/grape/route.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87b55239e7b98e9c8c7e5594eaf6c0aa972c435a
|
4
|
+
data.tar.gz: 16d060450d230d97ac721f12229d54c2bd5b45f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beb4fe2a550eec626c36da9f142725cd68b2ff699ee4ded6809353e516d63425d8b2ec3f6c846097345cc3874949e627675eb6c39d206bb63ed56a2cd14c9d4d
|
7
|
+
data.tar.gz: 5b6d3e6149bc6c2c86a3dce2a1bfc134d5c0c535b9ffee96fe2d367eedec3d355f53c381e211ab8d82de7152bdcfcf6e6851bb4492d24c5362477ed81727a98d
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2016-
|
3
|
+
# on 2016-11-24 18:42:08 +0800 using RuboCop version 0.45.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 29
|
10
10
|
Metrics/AbcSize:
|
11
11
|
Max: 56
|
12
12
|
|
13
13
|
# Offense count: 1
|
14
14
|
# Configuration parameters: CountComments.
|
15
15
|
Metrics/BlockLength:
|
16
|
-
Max:
|
16
|
+
Max: 29
|
17
17
|
|
18
18
|
# Offense count: 3
|
19
19
|
# Configuration parameters: CountComments.
|
20
20
|
Metrics/ClassLength:
|
21
21
|
Max: 265
|
22
22
|
|
23
|
-
# Offense count:
|
23
|
+
# Offense count: 12
|
24
24
|
Metrics/CyclomaticComplexity:
|
25
|
-
Max:
|
25
|
+
Max: 14
|
26
26
|
|
27
|
-
# Offense count:
|
27
|
+
# Offense count: 129
|
28
28
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives.
|
29
29
|
# URISchemes: http, https
|
30
30
|
Metrics/LineLength:
|
31
31
|
Max: 120
|
32
32
|
|
33
|
-
# Offense count:
|
33
|
+
# Offense count: 35
|
34
34
|
# Configuration parameters: CountComments.
|
35
35
|
Metrics/MethodLength:
|
36
|
-
Max:
|
36
|
+
Max: 40
|
37
37
|
|
38
|
-
# Offense count:
|
38
|
+
# Offense count: 7
|
39
39
|
Metrics/PerceivedComplexity:
|
40
|
-
Max:
|
40
|
+
Max: 15
|
41
41
|
|
42
42
|
# Offense count: 3
|
43
43
|
Style/ClassVars:
|
@@ -58,20 +58,13 @@ Style/FileName:
|
|
58
58
|
- 'spec/swagger_v2/api_swagger_v2_type-format_spec.rb'
|
59
59
|
- 'spec/swagger_v2/grape-swagger_spec.rb'
|
60
60
|
|
61
|
-
# Offense count: 94
|
62
|
-
# Cop supports --auto-correct.
|
63
|
-
# Configuration parameters: EnforcedStyle, SupportedStyles.
|
64
|
-
# SupportedStyles: when_needed, always
|
65
|
-
Style/FrozenStringLiteralComment:
|
66
|
-
Enabled: false
|
67
|
-
|
68
61
|
# Offense count: 1
|
69
62
|
# Cop supports --auto-correct.
|
70
63
|
Style/MultilineIfModifier:
|
71
64
|
Exclude:
|
72
65
|
- 'lib/grape-swagger/grape/route.rb'
|
73
66
|
|
74
|
-
# Offense count:
|
67
|
+
# Offense count: 5
|
75
68
|
# Cop supports --auto-correct.
|
76
69
|
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
|
77
70
|
# SupportedStyles: slashes, percent_r, mixed
|
data/.travis.yml
CHANGED
@@ -6,26 +6,29 @@ before_install:
|
|
6
6
|
|
7
7
|
matrix:
|
8
8
|
include:
|
9
|
-
- rvm: 2.
|
9
|
+
- rvm: 2.4.0
|
10
10
|
script:
|
11
11
|
- bundle exec danger
|
12
|
-
- rvm: 2.
|
12
|
+
- rvm: 2.4.0
|
13
13
|
env: MODEL_PARSER=grape-swagger-entity
|
14
|
-
- rvm: 2.
|
14
|
+
- rvm: 2.4.0
|
15
15
|
env: MODEL_PARSER=grape-swagger-representable
|
16
|
-
- rvm: 2.
|
17
|
-
env: GRAPE_VERSION=0.14.0
|
18
|
-
- rvm: 2.3.3
|
19
|
-
env: GRAPE_VERSION=0.15.0
|
20
|
-
- rvm: 2.3.3
|
16
|
+
- rvm: 2.4.0
|
21
17
|
env: GRAPE_VERSION=0.16.2
|
22
|
-
- rvm: 2.
|
18
|
+
- rvm: 2.4.0
|
23
19
|
env: GRAPE_VERSION=0.17.0
|
24
|
-
- rvm: 2.
|
20
|
+
- rvm: 2.4.0
|
25
21
|
env: GRAPE_VERSION=0.18.0
|
26
|
-
- rvm: 2.
|
22
|
+
- rvm: 2.4.0
|
23
|
+
env: GRAPE_VERSION=0.19.0
|
24
|
+
- rvm: 2.4.0
|
27
25
|
env: GRAPE_VERSION=HEAD
|
28
|
-
- rvm: 2.
|
26
|
+
- rvm: 2.3.3
|
27
|
+
env: MODEL_PARSER=grape-swagger-entity
|
28
|
+
- rvm: 2.3.3
|
29
|
+
env: MODEL_PARSER=grape-swagger-representable
|
30
|
+
- rvm: 2.3.3
|
31
|
+
- rvm: 2.2.6
|
29
32
|
- rvm: ruby-head
|
30
33
|
- rvm: jruby-9.1.6.0
|
31
34
|
- rvm: jruby-head
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,18 @@
|
|
8
8
|
|
9
9
|
* Your contribution here.
|
10
10
|
|
11
|
+
### 0.26.0 (January 9, 2017)
|
12
|
+
|
13
|
+
#### Features
|
14
|
+
|
15
|
+
* [#558](https://github.com/ruby-grape/grape-swagger/pull/558): Version cascading including dependency updates (includes: [LeFnord#27](https://github.com/LeFnord/grape-swagger/pull/27)) - [@LeFnord](https://github.com/LeFnord).
|
16
|
+
* [#535](https://github.com/ruby-grape/grape-swagger/pull/535): Add support for grape version cascading - [@qinix](https://github.com/qinix).
|
17
|
+
* [#560](https://github.com/ruby-grape/grape-swagger/pull/560): Map clearly Grape desc/detail to Swagger summary/description - [@frodrigo](https://github.com/frodrigo).
|
18
|
+
|
19
|
+
#### Fixes
|
20
|
+
|
21
|
+
* [#561](https://github.com/ruby-grape/grape-swagger/pull/561): Rename failures to failure in readme - [@justincampbell](https://github.com/justincampbell).
|
22
|
+
|
11
23
|
### 0.25.3 (December 18, 2016)
|
12
24
|
|
13
25
|
#### Features
|
data/Gemfile
CHANGED
@@ -4,7 +4,7 @@ ruby RUBY_VERSION
|
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
|
-
gem 'grape', case version = ENV['GRAPE_VERSION'] || '~> 0.
|
7
|
+
gem 'grape', case version = ENV['GRAPE_VERSION'] || '~> 0.19'
|
8
8
|
when 'HEAD'
|
9
9
|
{ github: 'ruby-grape/grape' }
|
10
10
|
else
|
@@ -23,7 +23,7 @@ group :development, :test do
|
|
23
23
|
gem 'rack-test'
|
24
24
|
gem 'rake'
|
25
25
|
gem 'rdoc'
|
26
|
-
gem 'redcarpet', platforms: [:mri]
|
26
|
+
gem 'redcarpet', '< 3.4', platforms: [:mri]
|
27
27
|
gem 'rouge', platforms: [:mri]
|
28
28
|
gem 'rspec', '~> 3.0'
|
29
29
|
gem 'rubocop', '~> 0.40'
|
@@ -32,5 +32,5 @@ end
|
|
32
32
|
group :test do
|
33
33
|
gem 'grape-entity'
|
34
34
|
gem 'grape-swagger-entity'
|
35
|
-
gem 'ruby-grape-danger', '~> 0.1.
|
35
|
+
gem 'ruby-grape-danger', '~> 0.1.1', require: false
|
36
36
|
end
|
data/README.md
CHANGED
@@ -54,6 +54,8 @@ grape-swagger | swagger spec | grape | grape-entity | represen
|
|
54
54
|
0.23.0 | 2.0 | >= 0.12.0 ... <= 0.17.0 | <= 0.5.1 | >= 2.4.1 |
|
55
55
|
0.24.0 | 2.0 | >= 0.12.0 ... <= 0.18.0 | <= 0.5.1 | >= 2.4.1 |
|
56
56
|
0.25.0 | 2.0 | >= 0.14.0 ... <= 0.18.0 | <= 0.5.2 | >= 2.4.1 |
|
57
|
+
0.25.2 | 2.0 | >= 0.14.0 ... <= 0.18.0 | <= 0.6.0 | >= 2.4.1 |
|
58
|
+
0.26.0 | 2.0 | >= 0.16.2 | <= 0.6.1 | >= 2.4.1 |
|
57
59
|
|
58
60
|
<a name="swagger-spec" />
|
59
61
|
## Swagger-Spec
|
@@ -523,7 +525,7 @@ desc 'Get all kittens!', {
|
|
523
525
|
is_array: true,
|
524
526
|
nickname: 'getKittens',
|
525
527
|
success: Entities::Kitten, # or success
|
526
|
-
|
528
|
+
failure: [[401, 'KittenBitesError', Entities::BadKitten]] # or failure
|
527
529
|
# also explicit as hash: [{ code: 401, mssage: 'KittenBitesError', model: Entities::BadKitten }]
|
528
530
|
produces: [ "array", "of", "mime_types" ],
|
529
531
|
consumes: [ "array", "of", "mime_types" ]
|
@@ -753,7 +755,7 @@ You can also document the HTTP status codes with a description and a specified m
|
|
753
755
|
In the following cases, the schema ref would be taken from route.
|
754
756
|
|
755
757
|
```ruby
|
756
|
-
desc 'thing',
|
758
|
+
desc 'thing', failure: [ { code: 400, message: 'Invalid parameter entry' } ]
|
757
759
|
get '/thing' do
|
758
760
|
...
|
759
761
|
end
|
@@ -762,7 +764,7 @@ end
|
|
762
764
|
```ruby
|
763
765
|
desc 'thing' do
|
764
766
|
params Entities::Something.documentation
|
765
|
-
|
767
|
+
failure [ { code: 400, message: 'Invalid parameter entry' } ]
|
766
768
|
end
|
767
769
|
get '/thing' do
|
768
770
|
...
|
@@ -770,7 +772,7 @@ end
|
|
770
772
|
```
|
771
773
|
|
772
774
|
```ruby
|
773
|
-
get '/thing',
|
775
|
+
get '/thing', failure: [
|
774
776
|
{ code: 400, message: 'Invalid parameter entry' },
|
775
777
|
{ code: 404, message: 'Not authorized' },
|
776
778
|
] do
|
@@ -780,7 +782,7 @@ end
|
|
780
782
|
|
781
783
|
By adding a `model` key, e.g. this would be taken.
|
782
784
|
```ruby
|
783
|
-
get '/thing',
|
785
|
+
get '/thing', failure: [
|
784
786
|
{ code: 400, message: 'General error' },
|
785
787
|
{ code: 422, message: 'Invalid parameter entry', model: Entities::ApiError }
|
786
788
|
] do
|
data/Rakefile
CHANGED
data/grape-swagger.gemspec
CHANGED
@@ -11,7 +11,8 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.summary = 'Add auto generated documentation to your Grape API that can be displayed with Swagger.'
|
12
12
|
s.license = 'MIT'
|
13
13
|
|
14
|
-
s.
|
14
|
+
s.required_ruby_version = '>= 2.2.6'
|
15
|
+
s.add_runtime_dependency 'grape', '>= 0.16.2'
|
15
16
|
|
16
17
|
s.files = `git ls-files`.split("\n")
|
17
18
|
s.test_files = `git ls-files -- {test,spec}/*`.split("\n")
|
data/lib/grape-swagger.rb
CHANGED
@@ -10,6 +10,7 @@ require 'grape-swagger/doc_methods/parse_params'
|
|
10
10
|
require 'grape-swagger/doc_methods/move_params'
|
11
11
|
require 'grape-swagger/doc_methods/headers'
|
12
12
|
require 'grape-swagger/doc_methods/build_model_definition'
|
13
|
+
require 'grape-swagger/doc_methods/version'
|
13
14
|
|
14
15
|
module GrapeSwagger
|
15
16
|
module DocMethods
|
@@ -15,7 +15,9 @@ module GrapeSwagger
|
|
15
15
|
item = path.gsub(%r{/{(.+?)}}, '').split('/').last.singularize.underscore.camelize || 'Item'
|
16
16
|
|
17
17
|
if route.version && options[:add_version]
|
18
|
-
|
18
|
+
version = GrapeSwagger::DocMethods::Version.get(route)
|
19
|
+
version = version.first while version.is_a?(Array)
|
20
|
+
path.sub!('{version}', version.to_s)
|
19
21
|
else
|
20
22
|
path.sub!('/{version}', '')
|
21
23
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module GrapeSwagger
|
3
|
+
module DocMethods
|
4
|
+
class Version
|
5
|
+
class << self
|
6
|
+
def get(route)
|
7
|
+
version = route.version
|
8
|
+
# for grape version 0.16.2, the version can be a string like '[:v1, :v2]'
|
9
|
+
# for grape version bigger than 0.16.2, the version can be a array like [:v1, :v2]
|
10
|
+
if version.is_a?(String) && version.start_with?('[') && version.end_with?(']')
|
11
|
+
instance_eval(version)
|
12
|
+
else
|
13
|
+
version
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -131,10 +131,8 @@ module Grape
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def description_object(route, markdown)
|
134
|
-
description = route.options[:desc] if route.options.key?(:desc)
|
135
134
|
description = route.description if route.description.present?
|
136
|
-
description =
|
137
|
-
description += "\n #{route.options[:detail]}" if route.options.key?(:detail)
|
135
|
+
description = route.options[:detail] if route.options.key?(:detail)
|
138
136
|
description = markdown.markdown(description.to_s).chomp if markdown
|
139
137
|
|
140
138
|
description
|
@@ -228,9 +226,11 @@ module Grape
|
|
228
226
|
end
|
229
227
|
|
230
228
|
def tag_object(route)
|
229
|
+
version = GrapeSwagger::DocMethods::Version.get(route)
|
230
|
+
version = [version] unless version.is_a?(Array)
|
231
231
|
Array(
|
232
232
|
route.path.split('{')[0].split('/').reject(&:empty?).delete_if do |i|
|
233
|
-
i == route.prefix.to_s || i
|
233
|
+
i == route.prefix.to_s || version.map(&:to_s).include?(i)
|
234
234
|
end.first
|
235
235
|
)
|
236
236
|
end
|
@@ -61,13 +61,17 @@ describe 'details' do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
specify do
|
64
|
+
expect(subject['paths']['/use_detail']['get']).to include('summary')
|
65
|
+
expect(subject['paths']['/use_detail']['get']['summary']).to eql 'This returns something'
|
64
66
|
expect(subject['paths']['/use_detail']['get']).to include('description')
|
65
|
-
expect(subject['paths']['/use_detail']['get']['description']).to eql
|
67
|
+
expect(subject['paths']['/use_detail']['get']['description']).to eql 'detailed description of the route'
|
66
68
|
end
|
67
69
|
|
68
70
|
specify do
|
71
|
+
expect(subject['paths']['/use_detail_block']['get']).to include('summary')
|
72
|
+
expect(subject['paths']['/use_detail_block']['get']['summary']).to eql 'This returns something'
|
69
73
|
expect(subject['paths']['/use_detail_block']['get']).to include('description')
|
70
|
-
expect(subject['paths']['/use_detail_block']['get']['description']).to eql
|
74
|
+
expect(subject['paths']['/use_detail_block']['get']['description']).to eql 'detailed description of the route inside the `desc` block'
|
71
75
|
end
|
72
76
|
end
|
73
77
|
|
@@ -104,7 +108,7 @@ describe 'details' do
|
|
104
108
|
specify do
|
105
109
|
expect(subject['paths']['/use_gfm_detail']['get']).to include('description')
|
106
110
|
expect(subject['paths']['/use_gfm_detail']['get']['description']).to eql(
|
107
|
-
"<h1 id=\"
|
111
|
+
"<h1 id=\"burgers-in-heaven\">Burgers in Heaven</h1>\n\n<blockquote>\n <p>A burger doesn’t come for free</p>\n</blockquote>\n\n<p>If you want to reserve a burger in heaven, you have to do<br />\nsome crazy stuff on earth.</p>\n\n<pre><code>def do_good\nputs 'help people'\nend\n</code></pre>\n\n<ul>\n <li><em>Will go to Heaven:</em> Probably</li>\n <li><em>Will go to Hell:</em> Probably not</li>\n</ul>"
|
108
112
|
)
|
109
113
|
end
|
110
114
|
end
|
@@ -142,7 +146,7 @@ describe 'details' do
|
|
142
146
|
specify do
|
143
147
|
expect(subject['paths']['/use_gfm_rc_detail']['get']).to include('description')
|
144
148
|
expect(subject['paths']['/use_gfm_rc_detail']['get']['description']).to eql(
|
145
|
-
"<h1>
|
149
|
+
"<h1>Burgers in Heaven</h1>\n\n<blockquote>\n<p>A burger doesn't come for free</p>\n</blockquote>\n\n<p>If you want to reserve a burger in heaven, you have to do\nsome crazy stuff on earth.</p>\n<pre class=\"highlight plaintext\"><code>def do_good\nputs 'help people'\nend\n</code></pre>\n<ul>\n<li><em>Will go to Heaven:</em> Probably</li>\n<li><em>Will go to Hell:</em> Probably not</li>\n</ul>"
|
146
150
|
)
|
147
151
|
end
|
148
152
|
end
|
@@ -6,14 +6,34 @@ describe 'namespace tags check while using prefix and version' do
|
|
6
6
|
before :all do
|
7
7
|
module TheApi
|
8
8
|
class NamespaceApi < Grape::API
|
9
|
-
version :v1
|
9
|
+
version [:v1, :v2]
|
10
|
+
end
|
11
|
+
|
12
|
+
class CascadingVersionApi < Grape::API
|
13
|
+
version :v2
|
14
|
+
|
15
|
+
namespace :hudson do
|
16
|
+
desc 'Document root'
|
17
|
+
get '/' do
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
namespace :colorado do
|
22
|
+
desc 'This gets something.',
|
23
|
+
notes: '_test_'
|
24
|
+
|
25
|
+
get '/simple' do
|
26
|
+
{ bla: 'something' }
|
27
|
+
end
|
28
|
+
end
|
10
29
|
end
|
11
30
|
end
|
12
31
|
|
13
32
|
class TagApi < Grape::API
|
14
33
|
prefix :api
|
34
|
+
mount TheApi::CascadingVersionApi
|
15
35
|
mount TheApi::NamespaceApi
|
16
|
-
add_swagger_documentation
|
36
|
+
add_swagger_documentation
|
17
37
|
end
|
18
38
|
end
|
19
39
|
|
@@ -43,6 +63,8 @@ describe 'namespace tags check while using prefix and version' do
|
|
43
63
|
expect(subject['paths']['/api/v1/thames/simple_with_headers']['get']['tags']).to eql(['thames'])
|
44
64
|
expect(subject['paths']['/api/v1/niles/items']['post']['tags']).to eql(['niles'])
|
45
65
|
expect(subject['paths']['/api/v1/niles/custom']['get']['tags']).to eql(['niles'])
|
66
|
+
expect(subject['paths']['/api/v2/hudson']['get']['tags']).to eql(['hudson'])
|
67
|
+
expect(subject['paths']['/api/v2/colorado/simple']['get']['tags']).to eql(['colorado'])
|
46
68
|
end
|
47
69
|
end
|
48
70
|
|
@@ -16,8 +16,8 @@ describe 'namespace' do
|
|
16
16
|
JSON.parse(last_response.body)['paths']['/aspace']['get']
|
17
17
|
end
|
18
18
|
|
19
|
-
it 'shows the namespace
|
20
|
-
expect(subject['
|
19
|
+
it 'shows the namespace summary in the json spec' do
|
20
|
+
expect(subject['summary']).to eql('Description for aspace')
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -36,8 +36,8 @@ describe 'namespace' do
|
|
36
36
|
JSON.parse(last_response.body)['paths']['/camelCases']['get']
|
37
37
|
end
|
38
38
|
|
39
|
-
it 'shows the namespace
|
40
|
-
expect(subject['
|
39
|
+
it 'shows the namespace summary in the json spec' do
|
40
|
+
expect(subject['summary']).to eql('Look! An endpoint.')
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -60,8 +60,8 @@ describe 'namespace' do
|
|
60
60
|
JSON.parse(last_response.body)['paths']['/bspace']['get']
|
61
61
|
end
|
62
62
|
|
63
|
-
it 'shows the namespace
|
64
|
-
expect(subject['
|
63
|
+
it 'shows the namespace summary in the json spec' do
|
64
|
+
expect(subject['summary']).to eql('Description for aspace')
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -84,8 +84,8 @@ describe 'namespace' do
|
|
84
84
|
JSON.parse(last_response.body)['paths']['/mounted/bspace']['get']
|
85
85
|
end
|
86
86
|
|
87
|
-
it 'shows the namespace
|
88
|
-
expect(subject['
|
87
|
+
it 'shows the namespace summary in the json spec' do
|
88
|
+
expect(subject['summary']).to eql('Description for aspace')
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
@@ -112,8 +112,8 @@ describe 'namespace' do
|
|
112
112
|
JSON.parse(last_response.body)['paths']['/mounted/bspace']['get']
|
113
113
|
end
|
114
114
|
|
115
|
-
it 'shows the namespace
|
116
|
-
expect(subject['
|
115
|
+
it 'shows the namespace summary in the json spec' do
|
116
|
+
expect(subject['summary']).to eql('Description for aspace')
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-swagger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.26.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Vandecasteele
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.16.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.16.2
|
27
27
|
description:
|
28
28
|
email:
|
29
29
|
- tim.vandecasteele@gmail.com
|
@@ -68,9 +68,9 @@ files:
|
|
68
68
|
- lib/grape-swagger/doc_methods/produces_consumes.rb
|
69
69
|
- lib/grape-swagger/doc_methods/status_codes.rb
|
70
70
|
- lib/grape-swagger/doc_methods/tag_name_description.rb
|
71
|
+
- lib/grape-swagger/doc_methods/version.rb
|
71
72
|
- lib/grape-swagger/endpoint.rb
|
72
73
|
- lib/grape-swagger/errors.rb
|
73
|
-
- lib/grape-swagger/grape/route.rb
|
74
74
|
- lib/grape-swagger/markdown/kramdown_adapter.rb
|
75
75
|
- lib/grape-swagger/markdown/redcarpet_adapter.rb
|
76
76
|
- lib/grape-swagger/model_parsers.rb
|
@@ -164,7 +164,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
164
|
requirements:
|
165
165
|
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
|
-
version:
|
167
|
+
version: 2.2.6
|
168
168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
169
|
requirements:
|
170
170
|
- - ">="
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# backwards compatibility for Grape < 0.16.0
|
2
|
-
module Grape
|
3
|
-
class Route
|
4
|
-
[:path, :prefix, :entity, :description, :settings, :params, :headers, :http_codes, :version]
|
5
|
-
.each do |m|
|
6
|
-
define_method m do
|
7
|
-
send "route_#{m}"
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def request_method
|
12
|
-
route_method
|
13
|
-
end
|
14
|
-
|
15
|
-
attr_reader :options
|
16
|
-
end
|
17
|
-
end if defined?(Grape::VERSION) && Gem::Version.new(::Grape::VERSION) < Gem::Version.new('0.16.0')
|