grape-swagger 0.34.2 → 1.3.0

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +86 -0
  3. data/.travis.yml +19 -12
  4. data/CHANGELOG.md +47 -4
  5. data/Gemfile +9 -3
  6. data/README.md +125 -12
  7. data/UPGRADING.md +34 -0
  8. data/grape-swagger.gemspec +1 -2
  9. data/lib/grape-swagger.rb +2 -2
  10. data/lib/grape-swagger/doc_methods.rb +65 -62
  11. data/lib/grape-swagger/doc_methods/build_model_definition.rb +53 -2
  12. data/lib/grape-swagger/doc_methods/data_type.rb +6 -6
  13. data/lib/grape-swagger/doc_methods/format_data.rb +2 -2
  14. data/lib/grape-swagger/doc_methods/operation_id.rb +2 -2
  15. data/lib/grape-swagger/doc_methods/parse_params.rb +19 -4
  16. data/lib/grape-swagger/endpoint.rb +37 -26
  17. data/lib/grape-swagger/endpoint/params_parser.rb +12 -5
  18. data/lib/grape-swagger/rake/oapi_tasks.rb +12 -2
  19. data/lib/grape-swagger/version.rb +1 -1
  20. data/spec/issues/427_entity_as_string_spec.rb +1 -1
  21. data/spec/issues/430_entity_definitions_spec.rb +7 -5
  22. data/spec/issues/784_extensions_on_params_spec.rb +38 -0
  23. data/spec/lib/data_type_spec.rb +14 -2
  24. data/spec/lib/endpoint/params_parser_spec.rb +2 -1
  25. data/spec/lib/endpoint_spec.rb +1 -1
  26. data/spec/lib/move_params_spec.rb +2 -2
  27. data/spec/lib/oapi_tasks_spec.rb +15 -5
  28. data/spec/support/empty_model_parser.rb +1 -2
  29. data/spec/support/mock_parser.rb +1 -2
  30. data/spec/support/model_parsers/entity_parser.rb +9 -9
  31. data/spec/support/model_parsers/mock_parser.rb +8 -8
  32. data/spec/support/model_parsers/representable_parser.rb +9 -9
  33. data/spec/swagger_v2/api_swagger_v2_hide_param_spec.rb +14 -3
  34. data/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb +2 -2
  35. data/spec/swagger_v2/api_swagger_v2_response_with_models_spec.rb +53 -0
  36. data/spec/swagger_v2/boolean_params_spec.rb +1 -1
  37. data/spec/swagger_v2/inheritance_and_discriminator_spec.rb +56 -0
  38. data/spec/swagger_v2/reference_entity_spec.rb +74 -29
  39. data/spec/swagger_v2/security_requirement_spec.rb +2 -2
  40. metadata +17 -31
@@ -3,15 +3,16 @@
3
3
  module GrapeSwagger
4
4
  module Endpoint
5
5
  class ParamsParser
6
- attr_reader :params, :settings
6
+ attr_reader :params, :settings, :endpoint
7
7
 
8
- def self.parse_request_params(params, settings)
9
- new(params, settings).parse_request_params
8
+ def self.parse_request_params(params, settings, endpoint)
9
+ new(params, settings, endpoint).parse_request_params
10
10
  end
11
11
 
12
- def initialize(params, settings)
12
+ def initialize(params, settings, endpoint)
13
13
  @params = params
14
14
  @settings = settings
15
+ @endpoint = endpoint
15
16
  end
16
17
 
17
18
  def parse_request_params
@@ -55,7 +56,13 @@ module GrapeSwagger
55
56
  return true unless param_options.key?(:documentation) && !param_options[:required]
56
57
 
57
58
  param_hidden = param_options[:documentation].fetch(:hidden, false)
58
- param_hidden = param_hidden.call if param_hidden.is_a?(Proc)
59
+ if param_hidden.is_a?(Proc)
60
+ param_hidden = if settings[:token_owner]
61
+ param_hidden.call(endpoint.send(settings[:token_owner].to_sym))
62
+ else
63
+ param_hidden.call
64
+ end
65
+ end
59
66
  !param_hidden
60
67
  end
61
68
 
@@ -10,17 +10,25 @@ module GrapeSwagger
10
10
  include Rack::Test::Methods
11
11
 
12
12
  attr_reader :oapi
13
- attr_reader :api_class
14
13
 
15
14
  def initialize(api_class)
16
15
  super()
17
16
 
18
- @api_class = api_class
17
+ if api_class.is_a? String
18
+ @api_class_name = api_class
19
+ else
20
+ @api_class = api_class
21
+ end
22
+
19
23
  define_tasks
20
24
  end
21
25
 
22
26
  private
23
27
 
28
+ def api_class
29
+ @api_class ||= @api_class_name.constantize
30
+ end
31
+
24
32
  def define_tasks
25
33
  namespace :oapi do
26
34
  fetch
@@ -66,6 +74,7 @@ module GrapeSwagger
66
74
 
67
75
  # helper methods
68
76
  #
77
+ # rubocop:disable Style/StringConcatenation
69
78
  def make_request
70
79
  get url_for
71
80
 
@@ -75,6 +84,7 @@ module GrapeSwagger
75
84
  )
76
85
  ) + "\n"
77
86
  end
87
+ # rubocop:enable Style/StringConcatenation
78
88
 
79
89
  def url_for
80
90
  oapi_route = api_class.routes[-2]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GrapeSwagger
4
- VERSION = '0.34.2'
4
+ VERSION = '1.3.0'
5
5
  end
@@ -35,5 +35,5 @@ describe '#427 nested entity given as string' do
35
35
  JSON.parse(last_response.body)['definitions']
36
36
  end
37
37
 
38
- specify { expect(subject.keys).to include 'RoleEntity', 'WithoutRole' }
38
+ specify { expect(subject.keys).to include 'RoleEntity', 'Permission_WithoutRole' }
39
39
  end
@@ -55,6 +55,8 @@ describe 'definition names' do
55
55
  class Class7
56
56
  class SeventhEntity < Class6::SixthEntity
57
57
  expose :seventh_thing
58
+
59
+ private_class_method :entity_name
58
60
  end
59
61
  end
60
62
  end
@@ -82,11 +84,11 @@ describe 'definition names' do
82
84
  JSON.parse(last_response.body)['definitions']
83
85
  end
84
86
 
85
- specify { expect(subject).to include 'Class1' }
86
- specify { expect(subject).to include 'Class2' }
87
+ specify { expect(subject).to include 'TestDefinition_DummyEntities_WithVeryLongName_AnotherGroupingModule_Class1' }
88
+ specify { expect(subject).to include 'TestDefinition_DummyEntities_WithVeryLongName_AnotherGroupingModule_Class2' }
87
89
  specify { expect(subject).to include 'FooKlass' }
88
- specify { expect(subject).to include 'FourthEntity' }
89
- specify { expect(subject).to include 'FithEntity' }
90
+ specify { expect(subject).to include 'TestDefinition_DummyEntities_WithVeryLongName_AnotherGroupingModule_Class4_FourthEntity' }
91
+ specify { expect(subject).to include 'TestDefinition_DummyEntities_WithVeryLongName_AnotherGroupingModule_Class5_FithEntity' }
90
92
  specify { expect(subject).to include 'BarKlass' }
91
- specify { expect(subject).to include 'SeventhEntity' }
93
+ specify { expect(subject).to include 'TestDefinition_DummyEntities_WithVeryLongName_AnotherGroupingModule_Class7_SeventhEntity' }
92
94
  end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe '#532 allow custom format' do
6
+ let(:app) do
7
+ Class.new(Grape::API) do
8
+ namespace :issue_784 do
9
+ params do
10
+ requires :logs, type: String, documentation: { format: 'log', x: { name: 'Log' } }
11
+ optional :phone_number, type: Integer, documentation: { format: 'phone_number', x: { name: 'PhoneNumber' } }
12
+ end
13
+
14
+ post do
15
+ present params
16
+ end
17
+ end
18
+
19
+ add_swagger_documentation format: :json
20
+ end
21
+ end
22
+
23
+ subject do
24
+ get '/swagger_doc'
25
+ JSON.parse(last_response.body)
26
+ end
27
+
28
+ let(:parameters) { subject['paths']['/issue_784']['post']['parameters'] }
29
+
30
+ specify do
31
+ expect(parameters).to eql(
32
+ [
33
+ { 'in' => 'formData', 'name' => 'logs', 'type' => 'string', 'format' => 'log', 'required' => true, 'x-name' => 'Log' },
34
+ { 'in' => 'formData', 'name' => 'phone_number', 'type' => 'integer', 'format' => 'phone_number', 'required' => false, 'x-name' => 'PhoneNumber' }
35
+ ]
36
+ )
37
+ end
38
+ end
@@ -49,14 +49,26 @@ describe GrapeSwagger::DocMethods::DataType do
49
49
  it { is_expected.to eq 'MyInteger' }
50
50
  end
51
51
 
52
+ describe 'Types in array with inherited entity_name' do
53
+ before do
54
+ stub_const 'EntityBase', Class.new
55
+ allow(EntityBase).to receive(:entity_name).and_return 'MyInteger'
56
+ stub_const 'MyEntity', Class.new(EntityBase)
57
+ end
58
+
59
+ let(:value) { { type: '[MyEntity]' } }
60
+
61
+ it { is_expected.to eq 'MyInteger' }
62
+ end
63
+
52
64
  describe 'Rack::Multipart::UploadedFile' do
53
65
  let(:value) { { type: Rack::Multipart::UploadedFile } }
54
66
 
55
67
  it { is_expected.to eq 'file' }
56
68
  end
57
69
 
58
- describe 'Virtus::Attribute::Boolean' do
59
- let(:value) { { type: Virtus::Attribute::Boolean } }
70
+ describe 'Grape::API::Boolean' do
71
+ let(:value) { { type: Grape::API::Boolean } }
60
72
 
61
73
  it { is_expected.to eq 'boolean' }
62
74
  end
@@ -5,8 +5,9 @@ require 'spec_helper'
5
5
  describe GrapeSwagger::Endpoint::ParamsParser do
6
6
  let(:settings) { {} }
7
7
  let(:params) { [] }
8
+ let(:endpoint) { nil }
8
9
 
9
- let(:parser) { described_class.new(params, settings) }
10
+ let(:parser) { described_class.new(params, settings, endpoint) }
10
11
 
11
12
  describe '#parse_request_params' do
12
13
  subject(:parse_request_params) { parser.parse_request_params }
@@ -49,7 +49,7 @@ describe Grape::Endpoint do
49
49
  describe 'parse_request_params' do
50
50
  let(:subject) { GrapeSwagger::Endpoint::ParamsParser }
51
51
  before do
52
- subject.send(:parse_request_params, params, {})
52
+ subject.send(:parse_request_params, params, {}, nil)
53
53
  end
54
54
 
55
55
  context 'when params do not contain an array' do
@@ -97,7 +97,7 @@ describe GrapeSwagger::DocMethods::MoveParams do
97
97
  let(:route_options) { { requirements: {} } }
98
98
  describe 'POST' do
99
99
  let(:params) { paths[path][:post][:parameters] }
100
- let(:route) { Grape::Router::Route.new('POST', path.dup, route_options) }
100
+ let(:route) { Grape::Router::Route.new('POST', path.dup, **route_options) }
101
101
 
102
102
  specify do
103
103
  subject.to_definition(path, params, route, definitions)
@@ -113,7 +113,7 @@ describe GrapeSwagger::DocMethods::MoveParams do
113
113
 
114
114
  describe 'POST' do
115
115
  let(:params) { paths['/in_body/{key}'][:put][:parameters] }
116
- let(:route) { Grape::Router::Route.new('PUT', path.dup, route_options) }
116
+ let(:route) { Grape::Router::Route.new('PUT', path.dup, **route_options) }
117
117
 
118
118
  specify do
119
119
  subject.to_definition(path, params, route, definitions)
@@ -3,8 +3,8 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  RSpec.describe GrapeSwagger::Rake::OapiTasks do
6
- let(:api) do
7
- item = Class.new(Grape::API) do
6
+ module Api
7
+ class Item < Grape::API
8
8
  version 'v1', using: :path
9
9
 
10
10
  namespace :item do
@@ -16,14 +16,24 @@ RSpec.describe GrapeSwagger::Rake::OapiTasks do
16
16
  end
17
17
  end
18
18
 
19
- Class.new(Grape::API) do
19
+ class Base < Grape::API
20
20
  prefix :api
21
- mount item
21
+ mount Api::Item
22
22
  add_swagger_documentation add_version: true
23
23
  end
24
24
  end
25
25
 
26
- subject { described_class.new(api) }
26
+ subject { described_class.new(Api::Base) }
27
+
28
+ describe '.new' do
29
+ it 'accepts class name as a constant' do
30
+ expect(described_class.new(::Api::Base).send(:api_class)).to eq(Api::Base)
31
+ end
32
+
33
+ it 'accepts class name as a string' do
34
+ expect(described_class.new('::Api::Base').send(:api_class)).to eq(Api::Base)
35
+ end
36
+ end
27
37
 
28
38
  describe '#make_request' do
29
39
  describe 'complete documentation' do
@@ -5,8 +5,7 @@ end
5
5
 
6
6
  module GrapeSwagger
7
7
  class EmptyModelParser
8
- attr_reader :model
9
- attr_reader :endpoint
8
+ attr_reader :model, :endpoint
10
9
 
11
10
  def initialize(model, endpoint)
12
11
  @model = model
@@ -2,8 +2,7 @@
2
2
 
3
3
  module GrapeSwagger
4
4
  class MockParser
5
- attr_reader :model
6
- attr_reader :endpoint
5
+ attr_reader :model, :endpoint
7
6
 
8
7
  def initialize(model, endpoint)
9
8
  @model = model
@@ -116,7 +116,7 @@ RSpec.shared_context 'entity swagger example' do
116
116
  expose :prop_time, documentation: { type: Time, desc: 'prop_time description' }
117
117
  expose :prop_password, documentation: { type: 'password', desc: 'prop_password description' }
118
118
  expose :prop_email, documentation: { type: 'email', desc: 'prop_email description' }
119
- expose :prop_boolean, documentation: { type: Virtus::Attribute::Boolean, desc: 'prop_boolean description' }
119
+ expose :prop_boolean, documentation: { type: Grape::API::Boolean, desc: 'prop_boolean description' }
120
120
  expose :prop_file, documentation: { type: File, desc: 'prop_file description' }
121
121
  expose :prop_json, documentation: { type: JSON, desc: 'prop_json description' }
122
122
  end
@@ -145,23 +145,23 @@ RSpec.shared_context 'entity swagger example' do
145
145
 
146
146
  let(:swagger_nested_type) do
147
147
  {
148
- 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'type' => 'integer', 'format' => 'int32', 'description' => 'status code' }, 'message' => { 'type' => 'string', 'description' => 'error message' } }, 'description' => 'This returns something' },
148
+ 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'type' => 'integer', 'format' => 'int32', 'description' => 'status code' }, 'message' => { 'type' => 'string', 'description' => 'error message' } }, 'description' => 'ApiError model' },
149
149
  'ResponseItem' => { 'type' => 'object', 'properties' => { 'id' => { 'type' => 'integer', 'format' => 'int32' }, 'name' => { 'type' => 'string' } } },
150
- 'UseItemResponseAsType' => { 'type' => 'object', 'properties' => { 'description' => { 'type' => 'string' }, 'responses' => { '$ref' => '#/definitions/ResponseItem' } }, 'description' => 'This returns something' }
150
+ 'UseItemResponseAsType' => { 'type' => 'object', 'properties' => { 'description' => { 'type' => 'string' }, 'responses' => { '$ref' => '#/definitions/ResponseItem' } }, 'description' => 'UseItemResponseAsType model' }
151
151
  }
152
152
  end
153
153
 
154
154
  let(:swagger_entity_as_response_object) do
155
155
  {
156
- 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'type' => 'integer', 'format' => 'int32', 'description' => 'status code' }, 'message' => { 'type' => 'string', 'description' => 'error message' } }, 'description' => 'This returns something' },
156
+ 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'type' => 'integer', 'format' => 'int32', 'description' => 'status code' }, 'message' => { 'type' => 'string', 'description' => 'error message' } }, 'description' => 'ApiError model' },
157
157
  'ResponseItem' => { 'type' => 'object', 'properties' => { 'id' => { 'type' => 'integer', 'format' => 'int32' }, 'name' => { 'type' => 'string' } } },
158
- 'UseResponse' => { 'type' => 'object', 'properties' => { 'description' => { 'type' => 'string' }, '$responses' => { 'type' => 'array', 'items' => { '$ref' => '#/definitions/ResponseItem' } } }, 'description' => 'This returns something' }
158
+ 'UseResponse' => { 'type' => 'object', 'properties' => { 'description' => { 'type' => 'string' }, '$responses' => { 'type' => 'array', 'items' => { '$ref' => '#/definitions/ResponseItem' } } }, 'description' => 'UseResponse model' }
159
159
  }
160
160
  end
161
161
 
162
162
  let(:swagger_params_as_response_object) do
163
163
  {
164
- 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'description' => 'status code', 'type' => 'integer', 'format' => 'int32' }, 'message' => { 'description' => 'error message', 'type' => 'string' } }, 'description' => 'This returns something' }
164
+ 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'description' => 'status code', 'type' => 'integer', 'format' => 'int32' }, 'message' => { 'description' => 'error message', 'type' => 'string' } }, 'description' => 'ApiError model' }
165
165
  }
166
166
  end
167
167
 
@@ -300,7 +300,7 @@ RSpec.shared_context 'entity swagger example' do
300
300
  'type' => 'object',
301
301
  'required' => ['elements'],
302
302
  'properties' => { 'elements' => { 'type' => 'array', 'items' => { '$ref' => '#/definitions/QueryInputElement' }, 'description' => 'Set of configuration' } },
303
- 'description' => 'nested route inside namespace'
303
+ 'description' => 'QueryInput model'
304
304
  },
305
305
  'QueryInputElement' => {
306
306
  'type' => 'object',
@@ -310,7 +310,7 @@ RSpec.shared_context 'entity swagger example' do
310
310
  'ApiError' => {
311
311
  'type' => 'object',
312
312
  'properties' => { 'code' => { 'type' => 'integer', 'format' => 'int32', 'description' => 'status code' }, 'message' => { 'type' => 'string', 'description' => 'error message' } },
313
- 'description' => 'This gets Things.'
313
+ 'description' => 'ApiError model'
314
314
  },
315
315
  'Something' => {
316
316
  'type' => 'object',
@@ -320,7 +320,7 @@ RSpec.shared_context 'entity swagger example' do
320
320
  'links' => { 'type' => 'array', 'items' => { 'type' => 'link' } },
321
321
  'others' => { 'type' => 'text' }
322
322
  },
323
- 'description' => 'This gets Things.'
323
+ 'description' => 'Something model'
324
324
  }
325
325
  }
326
326
  }
@@ -112,7 +112,7 @@ RSpec.shared_context 'mock swagger example' do
112
112
  'description' => "it's a mock"
113
113
  }
114
114
  },
115
- 'description' => 'This returns something'
115
+ 'description' => 'ApiError model'
116
116
  },
117
117
  'UseItemResponseAsType' => {
118
118
  'type' => 'object',
@@ -122,7 +122,7 @@ RSpec.shared_context 'mock swagger example' do
122
122
  'description' => "it's a mock"
123
123
  }
124
124
  },
125
- 'description' => 'This returns something'
125
+ 'description' => 'UseItemResponseAsType model'
126
126
  }
127
127
  }
128
128
  end
@@ -137,7 +137,7 @@ RSpec.shared_context 'mock swagger example' do
137
137
  'description' => "it's a mock"
138
138
  }
139
139
  },
140
- 'description' => 'This returns something'
140
+ 'description' => 'UseResponse model'
141
141
  },
142
142
  'ApiError' => {
143
143
  'type' => 'object',
@@ -147,7 +147,7 @@ RSpec.shared_context 'mock swagger example' do
147
147
  'description' => "it's a mock"
148
148
  }
149
149
  },
150
- 'description' => 'This returns something'
150
+ 'description' => 'ApiError model'
151
151
  }
152
152
  }
153
153
  end
@@ -162,7 +162,7 @@ RSpec.shared_context 'mock swagger example' do
162
162
  'description' => "it's a mock"
163
163
  }
164
164
  },
165
- 'description' => 'This returns something'
165
+ 'description' => 'ApiError model'
166
166
  }
167
167
  }
168
168
  end
@@ -296,7 +296,7 @@ RSpec.shared_context 'mock swagger example' do
296
296
  'description' => "it's a mock"
297
297
  }
298
298
  },
299
- 'description' => 'nested route inside namespace'
299
+ 'description' => 'QueryInput model'
300
300
  },
301
301
  'ApiError' => {
302
302
  'type' => 'object',
@@ -306,7 +306,7 @@ RSpec.shared_context 'mock swagger example' do
306
306
  'description' => "it's a mock"
307
307
  }
308
308
  },
309
- 'description' => 'This gets Things.'
309
+ 'description' => 'ApiError model'
310
310
  },
311
311
  'Something' => {
312
312
  'type' => 'object',
@@ -316,7 +316,7 @@ RSpec.shared_context 'mock swagger example' do
316
316
  'description' => "it's a mock"
317
317
  }
318
318
  },
319
- 'description' => 'This gets Things.'
319
+ 'description' => 'Something model'
320
320
  }
321
321
  }
322
322
  }
@@ -186,7 +186,7 @@ RSpec.shared_context 'representable swagger example' do
186
186
  property :prop_time, documentation: { type: Time, desc: 'prop_time description' }
187
187
  property :prop_password, documentation: { type: 'password', desc: 'prop_password description' }
188
188
  property :prop_email, documentation: { type: 'email', desc: 'prop_email description' }
189
- property :prop_boolean, documentation: { type: Virtus::Attribute::Boolean, desc: 'prop_boolean description' }
189
+ property :prop_boolean, documentation: { type: Grape::API::Boolean, desc: 'prop_boolean description' }
190
190
  property :prop_file, documentation: { type: File, desc: 'prop_file description' }
191
191
  property :prop_json, documentation: { type: JSON, desc: 'prop_json description' }
192
192
  end
@@ -218,22 +218,22 @@ RSpec.shared_context 'representable swagger example' do
218
218
 
219
219
  let(:swagger_nested_type) do
220
220
  {
221
- 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'description' => 'status code', 'type' => 'integer', 'format' => 'int32' }, 'message' => { 'description' => 'error message', 'type' => 'string' } }, 'description' => 'This returns something' },
222
- 'UseItemResponseAsType' => { 'type' => 'object', 'properties' => { 'description' => { 'description' => '', 'type' => 'string' }, 'responses' => { 'description' => '', 'type' => 'ResponseItem' } }, 'description' => 'This returns something' }
221
+ 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'description' => 'status code', 'type' => 'integer', 'format' => 'int32' }, 'message' => { 'description' => 'error message', 'type' => 'string' } }, 'description' => 'ApiError model' },
222
+ 'UseItemResponseAsType' => { 'type' => 'object', 'properties' => { 'description' => { 'description' => '', 'type' => 'string' }, 'responses' => { 'description' => '', 'type' => 'ResponseItem' } }, 'description' => 'UseItemResponseAsType model' }
223
223
  }
224
224
  end
225
225
 
226
226
  let(:swagger_entity_as_response_object) do
227
227
  {
228
- 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'description' => 'status code', 'type' => 'integer', 'format' => 'int32' }, 'message' => { 'description' => 'error message', 'type' => 'string' } }, 'description' => 'This returns something' },
228
+ 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'description' => 'status code', 'type' => 'integer', 'format' => 'int32' }, 'message' => { 'description' => 'error message', 'type' => 'string' } }, 'description' => 'ApiError model' },
229
229
  'ResponseItem' => { 'type' => 'object', 'properties' => { 'id' => { 'description' => '', 'type' => 'integer', 'format' => 'int32' }, 'name' => { 'description' => '', 'type' => 'string' } } },
230
- 'UseResponse' => { 'type' => 'object', 'properties' => { 'description' => { 'description' => '', 'type' => 'string' }, '$responses' => { 'type' => 'array', 'items' => { '$ref' => '#/definitions/ResponseItem' }, 'description' => '' } }, 'description' => 'This returns something' }
230
+ 'UseResponse' => { 'type' => 'object', 'properties' => { 'description' => { 'description' => '', 'type' => 'string' }, '$responses' => { 'type' => 'array', 'items' => { '$ref' => '#/definitions/ResponseItem' }, 'description' => '' } }, 'description' => 'UseResponse model' }
231
231
  }
232
232
  end
233
233
 
234
234
  let(:swagger_params_as_response_object) do
235
235
  {
236
- 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'description' => 'status code', 'type' => 'integer', 'format' => 'int32' }, 'message' => { 'description' => 'error message', 'type' => 'string' } }, 'description' => 'This returns something' }
236
+ 'ApiError' => { 'type' => 'object', 'properties' => { 'code' => { 'description' => 'status code', 'type' => 'integer', 'format' => 'int32' }, 'message' => { 'description' => 'error message', 'type' => 'string' } }, 'description' => 'ApiError model' }
237
237
  }
238
238
  end
239
239
 
@@ -372,7 +372,7 @@ RSpec.shared_context 'representable swagger example' do
372
372
  'type' => 'object',
373
373
  'required' => ['elements'],
374
374
  'properties' => { 'elements' => { 'type' => 'array', 'items' => { '$ref' => '#/definitions/QueryInputElement' }, 'description' => 'Set of configuration' } },
375
- 'description' => 'nested route inside namespace'
375
+ 'description' => 'QueryInput model'
376
376
  },
377
377
  'QueryInputElement' => {
378
378
  'type' => 'object',
@@ -382,7 +382,7 @@ RSpec.shared_context 'representable swagger example' do
382
382
  'ApiError' => {
383
383
  'type' => 'object',
384
384
  'properties' => { 'code' => { 'type' => 'integer', 'format' => 'int32', 'description' => 'status code' }, 'message' => { 'type' => 'string', 'description' => 'error message' } },
385
- 'description' => 'This gets Things.'
385
+ 'description' => 'ApiError model'
386
386
  },
387
387
  'Something' => {
388
388
  'type' => 'object',
@@ -392,7 +392,7 @@ RSpec.shared_context 'representable swagger example' do
392
392
  'links' => { 'type' => 'array', 'items' => { 'description' => '', 'type' => 'link' } },
393
393
  'others' => { 'description' => '', 'type' => 'text' }
394
394
  },
395
- 'description' => 'This gets Things.'
395
+ 'description' => 'Something model'
396
396
  }
397
397
  }
398
398
  }