grape-swagger 0.20.2 → 0.20.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/.rubocop.yml +0 -3
- data/.rubocop_todo.yml +43 -33
- data/.travis.yml +22 -13
- data/CHANGELOG.md +29 -53
- data/Gemfile +1 -1
- data/README.md +24 -24
- data/example/api/endpoints.rb +28 -29
- data/example/api/entities.rb +1 -1
- data/example/config.ru +5 -7
- data/grape-swagger.gemspec +1 -1
- data/lib/grape-swagger.rb +9 -6
- data/lib/grape-swagger/doc_methods.rb +1 -1
- data/lib/grape-swagger/doc_methods/extensions.rb +3 -3
- data/lib/grape-swagger/doc_methods/headers.rb +1 -1
- data/lib/grape-swagger/doc_methods/move_params.rb +25 -16
- data/lib/grape-swagger/doc_methods/operation_id.rb +2 -2
- data/lib/grape-swagger/doc_methods/parse_params.rb +12 -5
- data/lib/grape-swagger/doc_methods/path_string.rb +1 -1
- data/lib/grape-swagger/doc_methods/status_codes.rb +3 -1
- data/lib/grape-swagger/doc_methods/tag_name_description.rb +1 -1
- data/lib/grape-swagger/endpoint.rb +33 -46
- data/lib/grape-swagger/grape/route.rb +16 -0
- data/lib/grape-swagger/version.rb +1 -1
- data/spec/issues/403_versions_spec.rb +158 -0
- data/spec/lib/data_type_spec.rb +9 -10
- data/spec/lib/endpoint_spec.rb +1 -2
- data/spec/lib/extensions_spec.rb +44 -40
- data/spec/lib/move_params_spec.rb +113 -93
- data/spec/lib/operation_id_spec.rb +42 -12
- data/spec/lib/optional_object_spec.rb +3 -4
- data/spec/lib/path_string_spec.rb +2 -2
- data/spec/lib/produces_consumes_spec.rb +64 -53
- data/spec/markdown/redcarpet_adapter_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/support/api_swagger_v2_result.rb +122 -128
- data/spec/support/namespace_tags.rb +17 -19
- data/spec/support/the_api_entities.rb +1 -3
- data/spec/support/the_paths_definitions.rb +95 -85
- data/spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb +1 -1
- data/spec/swagger_v2/api_swagger_v2_detail_spec.rb +19 -19
- data/spec/swagger_v2/api_swagger_v2_extensions_spec.rb +21 -21
- data/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb +34 -32
- data/spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb +5 -7
- data/spec/swagger_v2/api_swagger_v2_headers_spec.rb +19 -18
- data/spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb +9 -10
- data/spec/swagger_v2/api_swagger_v2_mounted_spec.rb +21 -24
- data/spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb +90 -92
- data/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb +54 -54
- data/spec/swagger_v2/api_swagger_v2_param_type_spec.rb +65 -57
- data/spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb +17 -14
- data/spec/swagger_v2/api_swagger_v2_response_spec.rb +79 -123
- data/spec/swagger_v2/api_swagger_v2_spec.rb +33 -34
- data/spec/swagger_v2/api_swagger_v2_type-format_spec.rb +32 -36
- data/spec/swagger_v2/boolean_params_spec.rb +1 -1
- data/spec/swagger_v2/default_api_spec.rb +26 -29
- data/spec/swagger_v2/description_not_initialized.rb +3 -3
- data/spec/swagger_v2/float_api_spec.rb +1 -1
- data/spec/swagger_v2/form_params_spec.rb +4 -4
- data/spec/swagger_v2/hide_api_spec.rb +48 -51
- data/spec/swagger_v2/host.rb +1 -1
- data/spec/swagger_v2/mounted_target_class_spec.rb +31 -33
- data/spec/swagger_v2/namespace_tags_prefix_spec.rb +23 -21
- data/spec/swagger_v2/namespace_tags_spec.rb +23 -20
- data/spec/swagger_v2/param_type_spec.rb +5 -6
- data/spec/swagger_v2/param_values_spec.rb +31 -37
- data/spec/swagger_v2/params_array_spec.rb +17 -15
- data/spec/swagger_v2/params_hash_spec.rb +17 -15
- data/spec/swagger_v2/params_nested_spec.rb +12 -10
- data/spec/swagger_v2/reference_entity.rb +9 -9
- data/spec/swagger_v2/response_model_spec.rb +58 -62
- data/spec/swagger_v2/simple_mounted_api_spec.rb +179 -147
- metadata +5 -10
- data/spec/params_entity_spec.rb +0 -49
@@ -24,7 +24,7 @@ describe 'Boolean Params' do
|
|
24
24
|
|
25
25
|
it 'converts boolean types' do
|
26
26
|
expect(subject).to eq [
|
27
|
-
{
|
27
|
+
{ 'in' => 'formData', 'name' => 'a_boolean', 'type' => 'boolean', 'required' => true }
|
28
28
|
]
|
29
29
|
end
|
30
30
|
end
|
@@ -21,20 +21,19 @@ describe 'Default API' do
|
|
21
21
|
|
22
22
|
it 'documents api' do
|
23
23
|
expect(subject).to eq(
|
24
|
-
{
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
"responses"=>{"200"=>{"description"=>"This gets something."}}}}}}
|
24
|
+
'info' => { 'title' => 'API title', 'version' => '0.0.1' },
|
25
|
+
'swagger' => '2.0',
|
26
|
+
'produces' => ['application/json'],
|
27
|
+
'host' => 'example.org',
|
28
|
+
'tags' => [{ 'name' => 'something', 'description' => 'Operations about somethings' }],
|
29
|
+
'paths' => {
|
30
|
+
'/something' => {
|
31
|
+
'get' => {
|
32
|
+
'description' => 'This gets something.',
|
33
|
+
'produces' => ['application/json'],
|
34
|
+
'tags' => ['something'],
|
35
|
+
'operationId' => 'getSomething',
|
36
|
+
'responses' => { '200' => { 'description' => 'This gets something.' } } } } }
|
38
37
|
)
|
39
38
|
end
|
40
39
|
|
@@ -65,21 +64,19 @@ describe 'Default API' do
|
|
65
64
|
end
|
66
65
|
|
67
66
|
it 'documents endpoint' do
|
68
|
-
expect(subject).to eq({
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
"responses"=>{"200"=>{"description"=>"This gets something."}}}}}
|
82
|
-
})
|
67
|
+
expect(subject).to eq('info' => { 'title' => 'API title', 'version' => '0.0.1' },
|
68
|
+
'swagger' => '2.0',
|
69
|
+
'produces' => ['application/json'],
|
70
|
+
'host' => 'example.org',
|
71
|
+
'tags' => [{ 'name' => 'something', 'description' => 'Operations about somethings' }],
|
72
|
+
'paths' => {
|
73
|
+
'/something' => {
|
74
|
+
'get' => {
|
75
|
+
'description' => 'This gets something.',
|
76
|
+
'produces' => ['application/json'],
|
77
|
+
'tags' => ['something'],
|
78
|
+
'operationId' => 'getSomething',
|
79
|
+
'responses' => { '200' => { 'description' => 'This gets something.' } } } } })
|
83
80
|
end
|
84
81
|
end
|
85
82
|
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'details' do
|
4
4
|
describe 'details, pass markdown with redcarpet even with nil description and detail', unless: RUBY_PLATFORM.eql?('java') do
|
5
|
-
include_context
|
5
|
+
include_context 'the api entities'
|
6
6
|
|
7
7
|
before :all do
|
8
8
|
module TheApi
|
@@ -12,9 +12,9 @@ describe 'details' do
|
|
12
12
|
desc nil,
|
13
13
|
detail: nil,
|
14
14
|
entity: Entities::UseResponse,
|
15
|
-
failure: [{code: 400, model: Entities::ApiError}]
|
15
|
+
failure: [{ code: 400, model: Entities::ApiError }]
|
16
16
|
get '/use_gfm_rc_detail' do
|
17
|
-
{
|
17
|
+
{ 'declared_params' => declared(params) }
|
18
18
|
end
|
19
19
|
|
20
20
|
add_swagger_documentation markdown: GrapeSwagger::Markdown::RedcarpetAdapter.new
|
@@ -24,7 +24,7 @@ describe 'Float Params' do
|
|
24
24
|
|
25
25
|
it 'converts float types' do
|
26
26
|
expect(subject).to eq [
|
27
|
-
{
|
27
|
+
{ 'in' => 'formData', 'name' => 'a_float', 'type' => 'number', 'required' => true, 'format' => 'float' }
|
28
28
|
]
|
29
29
|
end
|
30
30
|
end
|
@@ -50,16 +50,16 @@ describe 'Form Params' do
|
|
50
50
|
|
51
51
|
it 'retrieves the documentation form params' do
|
52
52
|
expect(subject['paths'].length).to eq 2
|
53
|
-
expect(subject['paths'].keys).to include('/items','/items/{id}')
|
53
|
+
expect(subject['paths'].keys).to include('/items', '/items/{id}')
|
54
54
|
expect(subject['paths']['/items'].keys).to include 'post'
|
55
55
|
expect(subject['paths']['/items/{id}'].keys).to include('post', 'patch', 'put')
|
56
56
|
end
|
57
57
|
|
58
58
|
it 'treats Symbol parameter as form param' do
|
59
59
|
expect(subject['paths']['/items/{id}']['post']['parameters']).to eq [
|
60
|
-
{
|
61
|
-
{
|
62
|
-
{
|
60
|
+
{ 'in' => 'path', 'name' => 'id', 'description' => 'id of item', 'type' => 'integer', 'required' => true, 'format' => 'int32' },
|
61
|
+
{ 'in' => 'formData', 'name' => 'name', 'description' => 'name of item', 'type' => 'string', 'required' => true },
|
62
|
+
{ 'in' => 'formData', 'name' => 'conditions', 'description' => 'conditions of item', 'type' => 'string', 'required' => false, 'enum' => %w(one two) }
|
63
63
|
]
|
64
64
|
end
|
65
65
|
end
|
@@ -35,28 +35,27 @@ describe 'a hide mounted api' do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
it "retrieves swagger-documentation that doesn't include hidden endpoints" do
|
38
|
-
expect(subject).to eq(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
})
|
38
|
+
expect(subject).to eq(
|
39
|
+
'info' => { 'title' => 'API title', 'version' => '0.0.1' },
|
40
|
+
'swagger' => '2.0',
|
41
|
+
'produces' => ['application/xml', 'application/json', 'application/octet-stream', 'text/plain'],
|
42
|
+
'host' => 'example.org',
|
43
|
+
'tags' => [{ 'name' => 'simple', 'description' => 'Operations about simples' }, { 'name' => 'lazy', 'description' => 'Operations about lazies' }],
|
44
|
+
'paths' => {
|
45
|
+
'/simple' => {
|
46
|
+
'get' => {
|
47
|
+
'description' => 'Show this endpoint',
|
48
|
+
'produces' => ['application/json'],
|
49
|
+
'tags' => ['simple'],
|
50
|
+
'operationId' => 'getSimple',
|
51
|
+
'responses' => { '200' => { 'description' => 'Show this endpoint' } } } },
|
52
|
+
'/lazy' => {
|
53
|
+
'get' => {
|
54
|
+
'description' => 'Lazily show endpoint',
|
55
|
+
'produces' => ['application/json'],
|
56
|
+
'tags' => ['lazy'],
|
57
|
+
'operationId' => 'getLazy',
|
58
|
+
'responses' => { '200' => { 'description' => 'Lazily show endpoint' } } } } })
|
60
59
|
end
|
61
60
|
end
|
62
61
|
|
@@ -91,38 +90,36 @@ describe 'a hide mounted api with same namespace' do
|
|
91
90
|
|
92
91
|
it 'retrieves swagger-documentation on /swagger_doc' do
|
93
92
|
get '/swagger_doc.json'
|
94
|
-
expect(JSON.parse(last_response.body)).to eq(
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
})
|
93
|
+
expect(JSON.parse(last_response.body)).to eq(
|
94
|
+
'info' => { 'title' => 'API title', 'version' => '0.0.1' },
|
95
|
+
'swagger' => '2.0',
|
96
|
+
'produces' => ['application/xml', 'application/json', 'application/octet-stream', 'text/plain'],
|
97
|
+
'host' => 'example.org',
|
98
|
+
'tags' => [{ 'name' => 'simple', 'description' => 'Operations about simples' }],
|
99
|
+
'paths' => {
|
100
|
+
'/simple/show' => {
|
101
|
+
'get' => {
|
102
|
+
'description' => 'Show this endpoint',
|
103
|
+
'produces' => ['application/json'],
|
104
|
+
'operationId' => 'getSimpleShow',
|
105
|
+
'tags' => ['simple'], 'responses' => { '200' => { 'description' => 'Show this endpoint' } } } } })
|
108
106
|
end
|
109
107
|
|
110
108
|
it "retrieves the documentation for mounted-api that doesn't include hidden endpoints" do
|
111
109
|
get '/swagger_doc/simple.json'
|
112
|
-
expect(JSON.parse(last_response.body)).to eq(
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
})
|
110
|
+
expect(JSON.parse(last_response.body)).to eq(
|
111
|
+
'info' => { 'title' => 'API title', 'version' => '0.0.1' },
|
112
|
+
'swagger' => '2.0',
|
113
|
+
'produces' => ['application/xml', 'application/json', 'application/octet-stream', 'text/plain'],
|
114
|
+
'host' => 'example.org',
|
115
|
+
'tags' => [{ 'name' => 'simple', 'description' => 'Operations about simples' }],
|
116
|
+
'paths' => {
|
117
|
+
'/simple/show' => {
|
118
|
+
'get' => {
|
119
|
+
'description' => 'Show this endpoint',
|
120
|
+
'produces' => ['application/json'],
|
121
|
+
'tags' => ['simple'],
|
122
|
+
'operationId' => 'getSimpleShow',
|
123
|
+
'responses' => { '200' => { 'description' => 'Show this endpoint' } } } } })
|
127
124
|
end
|
128
125
|
end
|
data/spec/swagger_v2/host.rb
CHANGED
@@ -28,47 +28,45 @@ describe 'docs mounted separately from api' do
|
|
28
28
|
|
29
29
|
it 'retrieves docs for actual api class' do
|
30
30
|
get '/swagger_doc.json'
|
31
|
-
expect(JSON.parse(last_response.body)).to eq(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
31
|
+
expect(JSON.parse(last_response.body)).to eq(
|
32
|
+
'info' => { 'title' => 'API title', 'version' => '0.0.1' },
|
33
|
+
'swagger' => '2.0',
|
34
|
+
'produces' => ['application/xml', 'application/json', 'application/octet-stream', 'text/plain'],
|
35
|
+
'host' => 'example.org',
|
36
|
+
'tags' => [{ 'name' => 'simple', 'description' => 'Operations about simples' }],
|
37
|
+
'paths' => {
|
38
|
+
'/simple' => {
|
39
|
+
'get' => {
|
40
|
+
'description' => 'This gets something.',
|
41
|
+
'produces' => ['application/json'],
|
42
|
+
'responses' => { '200' => { 'description' => 'This gets something.' } },
|
43
|
+
'tags' => ['simple'],
|
44
|
+
'operationId' => 'getSimple'
|
45
45
|
}
|
46
46
|
}
|
47
|
-
}
|
48
|
-
})
|
47
|
+
})
|
49
48
|
end
|
50
49
|
|
51
50
|
it 'retrieves docs for endpoint in actual api class' do
|
52
51
|
get '/swagger_doc/simple.json'
|
53
|
-
expect(JSON.parse(last_response.body)).to eq(
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
52
|
+
expect(JSON.parse(last_response.body)).to eq(
|
53
|
+
'info' => { 'title' => 'API title', 'version' => '0.0.1' },
|
54
|
+
'swagger' => '2.0',
|
55
|
+
'tags' => [{ 'name' => 'simple', 'description' => 'Operations about simples' }],
|
56
|
+
'produces' => ['application/xml', 'application/json', 'application/octet-stream', 'text/plain'],
|
57
|
+
'host' => 'example.org',
|
58
|
+
'paths' => {
|
59
|
+
'/simple' => {
|
60
|
+
'get' => {
|
61
|
+
'description' => 'This gets something.',
|
62
|
+
'produces' => ['application/json'],
|
63
|
+
'responses' => {
|
64
|
+
'200' => { 'description' => 'This gets something.' }
|
66
65
|
},
|
67
|
-
|
68
|
-
|
66
|
+
'tags' => ['simple'],
|
67
|
+
'operationId' => 'getSimple'
|
69
68
|
}
|
70
69
|
}
|
71
|
-
}
|
72
|
-
})
|
70
|
+
})
|
73
71
|
end
|
74
72
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'namespace tags check while using prefix and version' do
|
4
|
-
include_context
|
4
|
+
include_context 'namespace example'
|
5
5
|
|
6
6
|
before :all do
|
7
7
|
module TheApi
|
@@ -21,19 +21,20 @@ describe 'namespace tags check while using prefix and version' do
|
|
21
21
|
TagApi
|
22
22
|
end
|
23
23
|
|
24
|
-
describe
|
24
|
+
describe 'retrieves swagger-documentation on /swagger_doc' do
|
25
25
|
subject do
|
26
26
|
get '/api/swagger_doc.json'
|
27
27
|
JSON.parse(last_response.body)
|
28
28
|
end
|
29
29
|
|
30
30
|
specify do
|
31
|
-
expect(subject['tags']).to eql(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
expect(subject['tags']).to eql(
|
32
|
+
[
|
33
|
+
{ 'name' => 'hudson', 'description' => 'Operations about hudsons' },
|
34
|
+
{ 'name' => 'colorado', 'description' => 'Operations about colorados' },
|
35
|
+
{ 'name' => 'thames', 'description' => 'Operations about thames' },
|
36
|
+
{ 'name' => 'niles', 'description' => 'Operations about niles' }
|
37
|
+
])
|
37
38
|
|
38
39
|
expect(subject['paths']['/api/v1/hudson']['get']['tags']).to eql(['hudson'])
|
39
40
|
expect(subject['paths']['/api/v1/colorado/simple']['get']['tags']).to eql(['colorado'])
|
@@ -44,7 +45,6 @@ describe 'namespace tags check while using prefix and version' do
|
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
47
|
-
|
48
48
|
describe 'retrieves the documentation for mounted-api' do
|
49
49
|
subject do
|
50
50
|
get '/api/swagger_doc/colorado.json'
|
@@ -52,12 +52,13 @@ describe 'namespace tags check while using prefix and version' do
|
|
52
52
|
end
|
53
53
|
|
54
54
|
specify do
|
55
|
-
expect(subject['tags']).to eql(
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
55
|
+
expect(subject['tags']).to eql(
|
56
|
+
[
|
57
|
+
{ 'name' => 'hudson', 'description' => 'Operations about hudsons' },
|
58
|
+
{ 'name' => 'colorado', 'description' => 'Operations about colorados' },
|
59
|
+
{ 'name' => 'thames', 'description' => 'Operations about thames' },
|
60
|
+
{ 'name' => 'niles', 'description' => 'Operations about niles' }
|
61
|
+
])
|
61
62
|
|
62
63
|
expect(subject['paths']['/api/v1/colorado/simple']['get']['tags']).to eql(['colorado'])
|
63
64
|
expect(subject['paths']['/api/v1/colorado/simple-test']['get']['tags']).to eql(['colorado'])
|
@@ -70,12 +71,13 @@ describe 'namespace tags check while using prefix and version' do
|
|
70
71
|
end
|
71
72
|
|
72
73
|
specify do
|
73
|
-
expect(subject['tags']).to eql(
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
expect(subject['tags']).to eql(
|
75
|
+
[
|
76
|
+
{ 'name' => 'hudson', 'description' => 'Operations about hudsons' },
|
77
|
+
{ 'name' => 'colorado', 'description' => 'Operations about colorados' },
|
78
|
+
{ 'name' => 'thames', 'description' => 'Operations about thames' },
|
79
|
+
{ 'name' => 'niles', 'description' => 'Operations about niles' }
|
80
|
+
])
|
79
81
|
|
80
82
|
expect(subject['paths']['/api/v1/thames/simple_with_headers']['get']['tags']).to eql(['thames'])
|
81
83
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'namespace tags check' do
|
4
|
-
include_context
|
4
|
+
include_context 'namespace example'
|
5
5
|
|
6
6
|
before :all do
|
7
7
|
class TestApi < Grape::API
|
@@ -14,19 +14,20 @@ describe 'namespace tags check' do
|
|
14
14
|
TestApi
|
15
15
|
end
|
16
16
|
|
17
|
-
describe
|
17
|
+
describe 'retrieves swagger-documentation on /swagger_doc' do
|
18
18
|
subject do
|
19
19
|
get '/swagger_doc.json'
|
20
20
|
JSON.parse(last_response.body)
|
21
21
|
end
|
22
22
|
|
23
23
|
specify do
|
24
|
-
expect(subject['tags']).to eql(
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
expect(subject['tags']).to eql(
|
25
|
+
[
|
26
|
+
{ 'name' => 'hudson', 'description' => 'Operations about hudsons' },
|
27
|
+
{ 'name' => 'colorado', 'description' => 'Operations about colorados' },
|
28
|
+
{ 'name' => 'thames', 'description' => 'Operations about thames' },
|
29
|
+
{ 'name' => 'niles', 'description' => 'Operations about niles' }
|
30
|
+
])
|
30
31
|
|
31
32
|
expect(subject['paths']['/hudson']['get']['tags']).to eql(['hudson'])
|
32
33
|
expect(subject['paths']['/colorado/simple']['get']['tags']).to eql(['colorado'])
|
@@ -44,12 +45,13 @@ describe 'namespace tags check' do
|
|
44
45
|
end
|
45
46
|
|
46
47
|
specify do
|
47
|
-
expect(subject['tags']).to eql(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
expect(subject['tags']).to eql(
|
49
|
+
[
|
50
|
+
{ 'name' => 'hudson', 'description' => 'Operations about hudsons' },
|
51
|
+
{ 'name' => 'colorado', 'description' => 'Operations about colorados' },
|
52
|
+
{ 'name' => 'thames', 'description' => 'Operations about thames' },
|
53
|
+
{ 'name' => 'niles', 'description' => 'Operations about niles' }
|
54
|
+
])
|
53
55
|
|
54
56
|
expect(subject['paths']['/colorado/simple']['get']['tags']).to eql(['colorado'])
|
55
57
|
expect(subject['paths']['/colorado/simple-test']['get']['tags']).to eql(['colorado'])
|
@@ -62,12 +64,13 @@ describe 'namespace tags check' do
|
|
62
64
|
end
|
63
65
|
|
64
66
|
specify do
|
65
|
-
expect(subject['tags']).to eql(
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
expect(subject['tags']).to eql(
|
68
|
+
[
|
69
|
+
{ 'name' => 'hudson', 'description' => 'Operations about hudsons' },
|
70
|
+
{ 'name' => 'colorado', 'description' => 'Operations about colorados' },
|
71
|
+
{ 'name' => 'thames', 'description' => 'Operations about thames' },
|
72
|
+
{ 'name' => 'niles', 'description' => 'Operations about niles' }
|
73
|
+
])
|
71
74
|
|
72
75
|
expect(subject['paths']['/thames/simple_with_headers']['get']['tags']).to eql(['thames'])
|
73
76
|
end
|