grape-swagger 1.4.2 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -75,7 +75,7 @@ describe '751 deeply nested objects' do
75
75
  end
76
76
 
77
77
  describe 'Correctness of vrp Points' do
78
- let(:get_points_response) { subject['definitions']['postVrpSubmit']['properties']['vrp']['properties']['points'] }
78
+ let(:get_points_response) { subject['definitions']['vrp']['properties']['vrp']['properties']['points'] }
79
79
  specify do
80
80
  expect(get_points_response).to eql(
81
81
  'type' => 'array',
@@ -111,7 +111,7 @@ describe '751 deeply nested objects' do
111
111
  end
112
112
 
113
113
  describe 'Correctness of vrp Services' do
114
- let(:get_service_response) { subject['definitions']['postVrpSubmit']['properties']['vrp']['properties']['services'] }
114
+ let(:get_service_response) { subject['definitions']['vrp']['properties']['vrp']['properties']['services'] }
115
115
  specify do
116
116
  expect(get_service_response).to include(
117
117
  'type' => 'array',
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe '#847 route_param type is included in documentation' do
6
+ let(:app) do
7
+ Class.new(Grape::API) do
8
+ resource :accounts do
9
+ route_param :account_number, type: String do
10
+ resource :records do
11
+ route_param :id do
12
+ get do
13
+ { message: 'hello world' }
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+
20
+ add_swagger_documentation
21
+ end
22
+ end
23
+ let(:parameters) { subject['paths']['/accounts/{account_number}/records/{id}']['get']['parameters'] }
24
+
25
+ subject do
26
+ get '/swagger_doc'
27
+ JSON.parse(last_response.body)
28
+ end
29
+
30
+ specify do
31
+ account_number_param = parameters.find { |param| param['name'] == 'account_number' }
32
+ expect(account_number_param['type']).to eq 'string'
33
+ id_param = parameters.find { |param| param['name'] == 'id' }
34
+ # Default is still integer
35
+ expect(id_param['type']).to eq 'integer'
36
+ end
37
+ end
@@ -103,15 +103,30 @@ describe GrapeSwagger::DocMethods::MoveParams do
103
103
  subject.to_definition(path, params, route, definitions)
104
104
  expect(params).to eql(
105
105
  [
106
- { name: 'InBody', in: 'body', required: true, schema: { '$ref' => '#/definitions/postInBody' } }
106
+ { name: 'postInBody', in: 'body', required: true, schema: { '$ref' => '#/definitions/postInBody' } }
107
107
  ]
108
108
  )
109
109
  expect(subject.definitions['postInBody']).not_to include :description
110
110
  expect(subject.definitions['postInBody']).to eql expected_post_defs
111
111
  end
112
+
113
+ context 'with a nickname' do
114
+ let(:route_options) { { nickname: 'post-body' } }
115
+
116
+ specify do
117
+ subject.to_definition(path, params, route, definitions)
118
+ expect(params).to eql(
119
+ [
120
+ { name: 'post-body', in: 'body', required: true, schema: { '$ref' => '#/definitions/post-body' } }
121
+ ]
122
+ )
123
+ expect(subject.definitions['post-body']).not_to include :description
124
+ expect(subject.definitions['post-body']).to eql expected_post_defs
125
+ end
126
+ end
112
127
  end
113
128
 
114
- describe 'POST' do
129
+ describe 'PUT' do
115
130
  let(:params) { paths['/in_body/{key}'][:put][:parameters] }
116
131
  let(:route) { Grape::Router::Route.new('PUT', path.dup, **route_options) }
117
132
 
@@ -120,12 +135,28 @@ describe GrapeSwagger::DocMethods::MoveParams do
120
135
  expect(params).to eql(
121
136
  [
122
137
  { in: 'path', name: 'key', description: nil, type: 'integer', format: 'int32', required: true },
123
- { name: 'InBody', in: 'body', required: true, schema: { '$ref' => '#/definitions/putInBody' } }
138
+ { name: 'putInBody', in: 'body', required: true, schema: { '$ref' => '#/definitions/putInBody' } }
124
139
  ]
125
140
  )
126
141
  expect(subject.definitions['putInBody']).not_to include :description
127
142
  expect(subject.definitions['putInBody']).to eql expected_put_defs
128
143
  end
144
+
145
+ context 'with a nickname' do
146
+ let(:route_options) { { nickname: 'put-body' } }
147
+
148
+ specify do
149
+ subject.to_definition(path, params, route, definitions)
150
+ expect(params).to eql(
151
+ [
152
+ { in: 'path', name: 'key', description: nil, type: 'integer', format: 'int32', required: true },
153
+ { name: 'put-body', in: 'body', required: true, schema: { '$ref' => '#/definitions/put-body' } }
154
+ ]
155
+ )
156
+ expect(subject.definitions['put-body']).not_to include :description
157
+ expect(subject.definitions['put-body']).to eql expected_put_defs
158
+ end
159
+ end
129
160
  end
130
161
  end
131
162
 
@@ -167,56 +198,39 @@ describe GrapeSwagger::DocMethods::MoveParams do
167
198
  let(:params) { [{ in: 'body', name: 'address[street][name]', description: 'street', type: 'string', required: true }] }
168
199
  before do
169
200
  subject.instance_variable_set(:@definitions, definitions)
170
- subject.send(:build_definition, name, params, verb)
201
+ subject.send(:build_definition, name, params)
171
202
  end
172
203
 
173
- describe 'verb given' do
174
- let(:verb) { 'post' }
175
- let(:name) { 'Foo' }
176
- let(:definitions) { {} }
204
+ let(:name) { 'FooBar' }
205
+ let(:definitions) { {} }
177
206
 
178
- specify do
179
- definition = definitions.to_a.first
180
- expect(definition.first).to eql 'postFoo'
181
- expect(definition.last).to eql(type: 'object', properties: {})
182
- end
183
- end
184
-
185
- describe 'no verb given' do
186
- let(:name) { 'FooBar' }
187
- let(:definitions) { {} }
188
- let(:verb) { nil }
189
-
190
- specify do
191
- definition = definitions.to_a.first
192
- expect(definition.first).to eql 'FooBar'
193
- expect(definition.last).to eql(type: 'object', properties: {})
194
- end
207
+ specify do
208
+ definition = definitions.to_a.first
209
+ expect(definition.first).to eql 'FooBar'
210
+ expect(definition.last).to eql(type: 'object', properties: {})
195
211
  end
196
212
  end
197
213
 
198
214
  describe 'build_body_parameter' do
199
- describe 'name given' do
200
- let(:name) { 'Foo' }
201
- let(:reference) { 'Bar' }
215
+ let(:name) { 'Foo' }
216
+ let(:reference) { 'Bar' }
217
+ let(:expected_param) do
218
+ { name: name, in: 'body', required: true, schema: { '$ref' => "#/definitions/#{name}" } }
219
+ end
220
+ specify do
221
+ parameter = subject.send(:build_body_parameter, name, {})
222
+ expect(parameter).to eql expected_param
223
+ end
224
+
225
+ describe 'body_name option specified' do
226
+ let(:route_options) { { body_name: 'body' } }
202
227
  let(:expected_param) do
203
- { name: name, in: 'body', required: true, schema: { '$ref' => "#/definitions/#{reference}" } }
228
+ { name: route_options[:body_name], in: 'body', required: true, schema: { '$ref' => "#/definitions/#{name}" } }
204
229
  end
205
230
  specify do
206
- parameter = subject.send(:build_body_parameter, reference, name, {})
231
+ parameter = subject.send(:build_body_parameter, name, route_options)
207
232
  expect(parameter).to eql expected_param
208
233
  end
209
-
210
- describe 'body_name option specified' do
211
- let(:route_options) { { body_name: 'body' } }
212
- let(:expected_param) do
213
- { name: route_options[:body_name], in: 'body', required: true, schema: { '$ref' => "#/definitions/#{reference}" } }
214
- end
215
- specify do
216
- parameter = subject.send(:build_body_parameter, reference, name, route_options)
217
- expect(parameter).to eql expected_param
218
- end
219
- end
220
234
  end
221
235
  end
222
236
 
@@ -25,6 +25,9 @@ RSpec.describe GrapeSwagger::Rake::OapiTasks do
25
25
 
26
26
  subject { described_class.new(Api::Base) }
27
27
 
28
+ let(:api_class) { subject.send(:api_class) }
29
+ let(:docs_url) { subject.send(:urls_for, api_class).first }
30
+
28
31
  describe '.new' do
29
32
  it 'accepts class name as a constant' do
30
33
  expect(described_class.new(::Api::Base).send(:api_class)).to eq(Api::Base)
@@ -38,7 +41,7 @@ RSpec.describe GrapeSwagger::Rake::OapiTasks do
38
41
  describe '#make_request' do
39
42
  describe 'complete documentation' do
40
43
  before do
41
- subject.send(:make_request)
44
+ subject.send(:make_request, docs_url)
42
45
  end
43
46
 
44
47
  describe 'not storing' do
@@ -51,7 +54,7 @@ RSpec.describe GrapeSwagger::Rake::OapiTasks do
51
54
  end
52
55
 
53
56
  it 'requests doc url' do
54
- expect(subject.send(:url_for)).to eql '/api/swagger_doc'
57
+ expect(docs_url).to eql '/api/swagger_doc'
55
58
  end
56
59
  end
57
60
 
@@ -68,10 +71,14 @@ RSpec.describe GrapeSwagger::Rake::OapiTasks do
68
71
  describe 'documentation for resource' do
69
72
  before do
70
73
  ENV['resource'] = resource
71
- subject.send(:make_request)
74
+ subject.send(:make_request, docs_url)
72
75
  end
73
76
 
74
- let(:response) { JSON.parse(subject.send(:make_request)) }
77
+ let(:response) do
78
+ JSON.parse(
79
+ subject.send(:make_request, docs_url)
80
+ )
81
+ end
75
82
 
76
83
  after { ENV.delete('resource') }
77
84
 
@@ -83,7 +90,7 @@ RSpec.describe GrapeSwagger::Rake::OapiTasks do
83
90
  end
84
91
 
85
92
  it 'requests doc url' do
86
- expect(subject.send(:url_for)).to eql "/api/swagger_doc/#{resource}"
93
+ expect(docs_url).to eql "/api/swagger_doc/#{resource}"
87
94
  end
88
95
 
89
96
  it 'has only one resource path' do
@@ -115,7 +122,7 @@ RSpec.describe GrapeSwagger::Rake::OapiTasks do
115
122
 
116
123
  describe 'call it' do
117
124
  before do
118
- subject.send(:make_request)
125
+ subject.send(:make_request, docs_url)
119
126
  end
120
127
  specify do
121
128
  expect(subject).to respond_to :oapi
@@ -128,7 +135,7 @@ RSpec.describe GrapeSwagger::Rake::OapiTasks do
128
135
  describe '#file' do
129
136
  describe 'no store given' do
130
137
  it 'returns swagger_doc.json' do
131
- expect(subject.send(:file)).to end_with 'swagger_doc.json'
138
+ expect(subject.send(:file, docs_url)).to end_with 'swagger_doc.json'
132
139
  end
133
140
  end
134
141
 
@@ -139,7 +146,7 @@ RSpec.describe GrapeSwagger::Rake::OapiTasks do
139
146
  before { ENV['store'] = 'true' }
140
147
 
141
148
  it 'returns swagger_doc.json' do
142
- expect(subject.send(:file)).to end_with 'swagger_doc.json'
149
+ expect(subject.send(:file, docs_url)).to end_with 'swagger_doc.json'
143
150
  end
144
151
  end
145
152
 
@@ -148,7 +155,7 @@ RSpec.describe GrapeSwagger::Rake::OapiTasks do
148
155
  before { ENV['store'] = name }
149
156
 
150
157
  it 'returns swagger_doc.json' do
151
- expect(subject.send(:file)).to end_with name
158
+ expect(subject.send(:file, docs_url)).to include(name.split('.')[0])
152
159
  end
153
160
  end
154
161
  end
data/spec/spec_helper.rb CHANGED
@@ -5,10 +5,6 @@ if RUBY_ENGINE == 'ruby'
5
5
  require 'coveralls'
6
6
 
7
7
  SimpleCov.formatter = Coveralls::SimpleCov::Formatter
8
- SimpleCov.start do
9
- add_filter 'spec/'
10
- add_filter 'example/'
11
- end
12
8
  Coveralls.wear!
13
9
  end
14
10
 
@@ -37,7 +37,7 @@ describe 'parsing additional_parameters' do
37
37
  specify do
38
38
  expect(subject.dig('paths', '/things', 'post', 'parameters')).to eql(
39
39
  [
40
- { 'name' => 'Things', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postThings' } }
40
+ { 'name' => 'postThings', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postThings' } }
41
41
  ]
42
42
  )
43
43
  end
@@ -136,7 +136,7 @@ describe 'moving body/formData Params to definitions' do
136
136
  specify do
137
137
  expect(subject['paths']['/simple_nested_params/in_body']['post']['parameters']).to eql(
138
138
  [
139
- { 'name' => 'SimpleNestedParamsInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postSimpleNestedParamsInBody' } }
139
+ { 'name' => 'postSimpleNestedParamsInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postSimpleNestedParamsInBody' } }
140
140
  ]
141
141
  )
142
142
  end
@@ -177,13 +177,13 @@ describe 'moving body/formData Params to definitions' do
177
177
  expect(subject['paths']['/simple_nested_params/in_body/{id}']['put']['parameters']).to eql(
178
178
  [
179
179
  { 'in' => 'path', 'name' => 'id', 'type' => 'integer', 'format' => 'int32', 'required' => true },
180
- { 'name' => 'SimpleNestedParamsInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putSimpleNestedParamsInBody' } }
180
+ { 'name' => 'putSimpleNestedParamsInBodyId', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putSimpleNestedParamsInBodyId' } }
181
181
  ]
182
182
  )
183
183
  end
184
184
 
185
185
  specify do
186
- expect(subject['definitions']['putSimpleNestedParamsInBody']).to eql(
186
+ expect(subject['definitions']['putSimpleNestedParamsInBodyId']).to eql(
187
187
  'type' => 'object',
188
188
  'properties' => {
189
189
  'name' => { 'type' => 'string', 'description' => 'name' },
@@ -214,7 +214,7 @@ describe 'moving body/formData Params to definitions' do
214
214
  expect(subject['paths']['/multiple_nested_params/in_body']['post']['parameters']).to eql(
215
215
  [
216
216
  {
217
- 'name' => 'MultipleNestedParamsInBody',
217
+ 'name' => 'postMultipleNestedParamsInBody',
218
218
  'in' => 'body',
219
219
  'required' => true,
220
220
  'schema' => { '$ref' => '#/definitions/postMultipleNestedParamsInBody' }
@@ -267,13 +267,13 @@ describe 'moving body/formData Params to definitions' do
267
267
  expect(subject['paths']['/multiple_nested_params/in_body/{id}']['put']['parameters']).to eql(
268
268
  [
269
269
  { 'in' => 'path', 'name' => 'id', 'type' => 'integer', 'format' => 'int32', 'required' => true },
270
- { 'name' => 'MultipleNestedParamsInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putMultipleNestedParamsInBody' } }
270
+ { 'name' => 'putMultipleNestedParamsInBodyId', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putMultipleNestedParamsInBodyId' } }
271
271
  ]
272
272
  )
273
273
  end
274
274
 
275
275
  specify do
276
- expect(subject['definitions']['putMultipleNestedParamsInBody']).to eql(
276
+ expect(subject['definitions']['putMultipleNestedParamsInBodyId']).to eql(
277
277
  'type' => 'object',
278
278
  'properties' => {
279
279
  'name' => { 'type' => 'string', 'description' => 'name' },
@@ -313,7 +313,7 @@ describe 'moving body/formData Params to definitions' do
313
313
  specify do
314
314
  expect(subject['paths']['/nested_params_array/in_body']['post']['parameters']).to eql(
315
315
  [
316
- { 'name' => 'NestedParamsArrayInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postNestedParamsArrayInBody' } }
316
+ { 'name' => 'postNestedParamsArrayInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postNestedParamsArrayInBody' } }
317
317
  ]
318
318
  )
319
319
  end
@@ -85,7 +85,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
85
85
  specify do
86
86
  expect(subject['paths']['/wo_entities/in_body']['post']['parameters']).to eql(
87
87
  [
88
- { 'name' => 'WoEntitiesInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postWoEntitiesInBody' } }
88
+ { 'name' => 'postWoEntitiesInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postWoEntitiesInBody' } }
89
89
  ]
90
90
  )
91
91
  end
@@ -107,13 +107,13 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
107
107
  expect(subject['paths']['/wo_entities/in_body/{key}']['put']['parameters']).to eql(
108
108
  [
109
109
  { 'in' => 'path', 'name' => 'key', 'type' => 'integer', 'format' => 'int32', 'required' => true },
110
- { 'name' => 'WoEntitiesInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putWoEntitiesInBody' } }
110
+ { 'name' => 'putWoEntitiesInBodyKey', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putWoEntitiesInBodyKey' } }
111
111
  ]
112
112
  )
113
113
  end
114
114
 
115
115
  specify do
116
- expect(subject['definitions']['putWoEntitiesInBody']).to eql(
116
+ expect(subject['definitions']['putWoEntitiesInBodyKey']).to eql(
117
117
  'description' => 'put in body /wo entity',
118
118
  'type' => 'object',
119
119
  'properties' => {
@@ -134,7 +134,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
134
134
  specify do
135
135
  expect(subject['paths']['/with_entities/in_body']['post']['parameters']).to eql(
136
136
  [
137
- { 'name' => 'WithEntitiesInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postWithEntitiesInBody' } }
137
+ { 'name' => 'postWithEntitiesInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postWithEntitiesInBody' } }
138
138
  ]
139
139
  )
140
140
  end
@@ -154,13 +154,13 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
154
154
  expect(subject['paths']['/with_entities/in_body/{id}']['put']['parameters']).to eql(
155
155
  [
156
156
  { 'in' => 'path', 'name' => 'id', 'type' => 'integer', 'format' => 'int32', 'required' => true },
157
- { 'name' => 'WithEntitiesInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putWithEntitiesInBody' } }
157
+ { 'name' => 'putWithEntitiesInBodyId', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putWithEntitiesInBodyId' } }
158
158
  ]
159
159
  )
160
160
  end
161
161
 
162
162
  specify do
163
- expect(subject['definitions']['putWithEntitiesInBody']).to eql(
163
+ expect(subject['definitions']['putWithEntitiesInBodyId']).to eql(
164
164
  'type' => 'object',
165
165
  'properties' => {
166
166
  'name' => { 'type' => 'string', 'description' => 'name' }
@@ -174,7 +174,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
174
174
  let(:request_parameters_definition) do
175
175
  [
176
176
  {
177
- 'name' => 'WithEntityParam',
177
+ 'name' => 'postWithEntityParam',
178
178
  'in' => 'body',
179
179
  'required' => true,
180
180
  'schema' => {
@@ -141,7 +141,7 @@ describe 'Convert values to enum for float range and not arrays inside a proc',
141
141
  'name' => 'letter',
142
142
  'type' => 'string',
143
143
  'required' => true,
144
- 'enum' => 'string'
144
+ 'enum' => %w[string]
145
145
  }]
146
146
  end
147
147
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-swagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - LeFnord
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-22 00:00:00.000000000 Z
12
+ date: 2022-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: grape
@@ -35,8 +35,7 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - ".coveralls.yml"
37
37
  - ".github/dependabot.yml"
38
- - ".github/workflows/rubocop.yml"
39
- - ".github/workflows/ruby.yml"
38
+ - ".github/workflows/ci.yml"
40
39
  - ".gitignore"
41
40
  - ".rspec"
42
41
  - ".rubocop.yml"
@@ -103,6 +102,7 @@ files:
103
102
  - spec/issues/784_extensions_on_params_spec.rb
104
103
  - spec/issues/809_utf8_routes_spec.rb
105
104
  - spec/issues/832_array_hash_float_decimal_spec.rb
105
+ - spec/issues/847_route_param_options_spec.rb
106
106
  - spec/lib/data_type_spec.rb
107
107
  - spec/lib/endpoint/params_parser_spec.rb
108
108
  - spec/lib/endpoint_spec.rb
@@ -189,7 +189,8 @@ files:
189
189
  homepage: https://github.com/ruby-grape/grape-swagger
190
190
  licenses:
191
191
  - MIT
192
- metadata: {}
192
+ metadata:
193
+ rubygems_mfa_required: 'true'
193
194
  post_install_message:
194
195
  rdoc_options: []
195
196
  require_paths:
@@ -198,121 +199,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
198
199
  requirements:
199
200
  - - ">="
200
201
  - !ruby/object:Gem::Version
201
- version: '2.5'
202
+ version: '2.7'
202
203
  required_rubygems_version: !ruby/object:Gem::Requirement
203
204
  requirements:
204
205
  - - ">="
205
206
  - !ruby/object:Gem::Version
206
207
  version: '0'
207
208
  requirements: []
208
- rubygems_version: 3.2.22
209
+ rubygems_version: 3.3.7
209
210
  signing_key:
210
211
  specification_version: 4
211
212
  summary: Add auto generated documentation to your Grape API that can be displayed
212
213
  with Swagger.
213
- test_files:
214
- - spec/issues/267_nested_namespaces.rb
215
- - spec/issues/403_versions_spec.rb
216
- - spec/issues/427_entity_as_string_spec.rb
217
- - spec/issues/430_entity_definitions_spec.rb
218
- - spec/issues/532_allow_custom_format_spec.rb
219
- - spec/issues/533_specify_status_code_spec.rb
220
- - spec/issues/537_enum_values_spec.rb
221
- - spec/issues/539_array_post_body_spec.rb
222
- - spec/issues/542_array_of_type_in_post_body_spec.rb
223
- - spec/issues/553_align_array_put_post_params_spec.rb
224
- - spec/issues/572_array_post_body_spec.rb
225
- - spec/issues/579_align_put_post_parameters_spec.rb
226
- - spec/issues/582_file_response_spec.rb
227
- - spec/issues/587_range_parameter_delimited_by_dash_spec.rb
228
- - spec/issues/605_root_route_documentation_spec.rb
229
- - spec/issues/650_params_array_spec.rb
230
- - spec/issues/680_keep_204_error_schemas_spec.rb
231
- - spec/issues/751_deeply_nested_objects_spec.rb
232
- - spec/issues/776_multiple_presents_spec.rb
233
- - spec/issues/784_extensions_on_params_spec.rb
234
- - spec/issues/809_utf8_routes_spec.rb
235
- - spec/issues/832_array_hash_float_decimal_spec.rb
236
- - spec/lib/data_type_spec.rb
237
- - spec/lib/endpoint/params_parser_spec.rb
238
- - spec/lib/endpoint_spec.rb
239
- - spec/lib/extensions_spec.rb
240
- - spec/lib/format_data_spec.rb
241
- - spec/lib/model_parsers_spec.rb
242
- - spec/lib/move_params_spec.rb
243
- - spec/lib/oapi_tasks_spec.rb
244
- - spec/lib/operation_id_spec.rb
245
- - spec/lib/optional_object_spec.rb
246
- - spec/lib/parse_params_spec.rb
247
- - spec/lib/path_string_spec.rb
248
- - spec/lib/produces_consumes_spec.rb
249
- - spec/lib/tag_name_description_spec.rb
250
- - spec/lib/version_spec.rb
251
- - spec/spec_helper.rb
252
- - spec/support/empty_model_parser.rb
253
- - spec/support/grape_version.rb
254
- - spec/support/mock_parser.rb
255
- - spec/support/model_parsers/entity_parser.rb
256
- - spec/support/model_parsers/mock_parser.rb
257
- - spec/support/model_parsers/representable_parser.rb
258
- - spec/support/namespace_tags.rb
259
- - spec/support/the_paths_definitions.rb
260
- - spec/swagger_v2/api_documentation_spec.rb
261
- - spec/swagger_v2/api_swagger_v2_additional_properties_spec.rb
262
- - spec/swagger_v2/api_swagger_v2_body_definitions_spec.rb
263
- - spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
264
- - spec/swagger_v2/api_swagger_v2_detail_spec.rb
265
- - spec/swagger_v2/api_swagger_v2_extensions_spec.rb
266
- - spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb
267
- - spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb
268
- - spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb
269
- - spec/swagger_v2/api_swagger_v2_headers_spec.rb
270
- - spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb
271
- - spec/swagger_v2/api_swagger_v2_hide_param_spec.rb
272
- - spec/swagger_v2/api_swagger_v2_ignore_defaults_spec.rb
273
- - spec/swagger_v2/api_swagger_v2_mounted_spec.rb
274
- - spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb
275
- - spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb
276
- - spec/swagger_v2/api_swagger_v2_param_type_spec.rb
277
- - spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb
278
- - spec/swagger_v2/api_swagger_v2_response_spec.rb
279
- - spec/swagger_v2/api_swagger_v2_response_with_examples_spec.rb
280
- - spec/swagger_v2/api_swagger_v2_response_with_headers_spec.rb
281
- - spec/swagger_v2/api_swagger_v2_response_with_models_spec.rb
282
- - spec/swagger_v2/api_swagger_v2_response_with_root_spec.rb
283
- - spec/swagger_v2/api_swagger_v2_spec.rb
284
- - spec/swagger_v2/api_swagger_v2_status_codes_spec.rb
285
- - spec/swagger_v2/api_swagger_v2_type-format_spec.rb
286
- - spec/swagger_v2/boolean_params_spec.rb
287
- - spec/swagger_v2/default_api_spec.rb
288
- - spec/swagger_v2/deprecated_field_spec.rb
289
- - spec/swagger_v2/description_not_initialized_spec.rb
290
- - spec/swagger_v2/endpoint_versioned_path_spec.rb
291
- - spec/swagger_v2/errors_spec.rb
292
- - spec/swagger_v2/float_api_spec.rb
293
- - spec/swagger_v2/form_params_spec.rb
294
- - spec/swagger_v2/grape-swagger_spec.rb
295
- - spec/swagger_v2/guarded_endpoint_spec.rb
296
- - spec/swagger_v2/hide_api_spec.rb
297
- - spec/swagger_v2/host_spec.rb
298
- - spec/swagger_v2/inheritance_and_discriminator_spec.rb
299
- - spec/swagger_v2/mount_override_api_spec.rb
300
- - spec/swagger_v2/mounted_target_class_spec.rb
301
- - spec/swagger_v2/namespace_tags_prefix_spec.rb
302
- - spec/swagger_v2/namespace_tags_spec.rb
303
- - spec/swagger_v2/namespaced_api_spec.rb
304
- - spec/swagger_v2/nicknamed_api_spec.rb
305
- - spec/swagger_v2/operation_id_api_spec.rb
306
- - spec/swagger_v2/param_multi_type_spec.rb
307
- - spec/swagger_v2/param_type_spec.rb
308
- - spec/swagger_v2/param_values_spec.rb
309
- - spec/swagger_v2/params_array_collection_format_spec.rb
310
- - spec/swagger_v2/params_array_spec.rb
311
- - spec/swagger_v2/params_example_spec.rb
312
- - spec/swagger_v2/params_hash_spec.rb
313
- - spec/swagger_v2/params_nested_spec.rb
314
- - spec/swagger_v2/parent_less_namespace_spec.rb
315
- - spec/swagger_v2/reference_entity_spec.rb
316
- - spec/swagger_v2/security_requirement_spec.rb
317
- - spec/swagger_v2/simple_mounted_api_spec.rb
318
- - spec/version_spec.rb
214
+ test_files: []
@@ -1,26 +0,0 @@
1
- name: Rubocop
2
-
3
- on:
4
- push:
5
- branches:
6
- - '*'
7
- pull_request:
8
- branches:
9
- - '*'
10
-
11
- jobs:
12
- rubocop:
13
- name: Rubocop
14
- runs-on: ubuntu-latest
15
- steps:
16
- - uses: actions/checkout@v2
17
- - uses: actions/setup-ruby@v1
18
- with:
19
- ruby-version: '3.0'
20
- - run: gem install rubocop --no-doc
21
- - run: rubocop --format progress --format json --out rubocop.json
22
- id: rubocop
23
- - uses: duderman/rubocop-annotate-action@v0.1.0
24
- with:
25
- path: rubocop.json
26
- if: ${{ failure() }}
@@ -1,30 +0,0 @@
1
- name: Ruby
2
-
3
- on:
4
- push:
5
- branches:
6
- - '*'
7
- pull_request:
8
- branches:
9
- - '*'
10
-
11
- jobs:
12
- rspec:
13
- runs-on: ubuntu-latest
14
- strategy:
15
- matrix:
16
- ruby-version: ['2.6', '2.7', '3.0', 'head']
17
- grape-version: [1.6.0, 1.5.3]
18
- model-parser: [grape-swagger-entity, grape-swagger-representable, '']
19
-
20
- steps:
21
- - uses: actions/checkout@v2
22
- - name: Set up Ruby
23
- uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
24
- with:
25
- ruby-version: ${{ matrix.ruby-version }}
26
- GRAPE_VERSION: ${{ matrix.grape-version }}
27
- MODEL_PARSER: ${{ matrix.model-parser }}
28
- bundler-cache: true
29
- - name: Run rspec
30
- run: bundle exec rspec