grape-swagger 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +6 -0
  3. data/.github/workflows/ci.yml +45 -0
  4. data/.gitignore +1 -0
  5. data/.rspec +2 -0
  6. data/.rubocop.yml +8 -1
  7. data/.rubocop_todo.yml +31 -11
  8. data/CHANGELOG.md +49 -1
  9. data/CONTRIBUTING.md +1 -1
  10. data/Gemfile +6 -3
  11. data/README.md +40 -8
  12. data/UPGRADING.md +15 -0
  13. data/example/config.ru +2 -2
  14. data/grape-swagger.gemspec +3 -2
  15. data/lib/grape-swagger/doc_methods/build_model_definition.rb +1 -20
  16. data/lib/grape-swagger/doc_methods/format_data.rb +2 -0
  17. data/lib/grape-swagger/doc_methods/move_params.rb +13 -15
  18. data/lib/grape-swagger/doc_methods/parse_params.rb +34 -6
  19. data/lib/grape-swagger/endpoint.rb +27 -1
  20. data/lib/grape-swagger/rake/oapi_tasks.rb +37 -17
  21. data/lib/grape-swagger/version.rb +1 -1
  22. data/lib/grape-swagger.rb +2 -2
  23. data/spec/issues/579_align_put_post_parameters_spec.rb +5 -5
  24. data/spec/issues/751_deeply_nested_objects_spec.rb +2 -2
  25. data/spec/issues/832_array_hash_float_decimal_spec.rb +111 -0
  26. data/spec/issues/847_route_param_options_spec.rb +37 -0
  27. data/spec/lib/move_params_spec.rb +55 -41
  28. data/spec/lib/oapi_tasks_spec.rb +16 -9
  29. data/spec/spec_helper.rb +0 -4
  30. data/spec/support/the_paths_definitions.rb +4 -4
  31. data/spec/swagger_v2/api_swagger_v2_additional_properties_spec.rb +83 -0
  32. data/spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb +79 -7
  33. data/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb +7 -7
  34. data/spec/swagger_v2/boolean_params_spec.rb +3 -1
  35. data/spec/swagger_v2/param_values_spec.rb +1 -1
  36. metadata +11 -111
  37. data/.github/workflows/rubocop.yml +0 -26
  38. data/.github/workflows/ruby.yml +0 -32
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe 'parsing additional_parameters' do
6
+ let(:app) do
7
+ Class.new(Grape::API) do
8
+ namespace :things do
9
+ class Element < Grape::Entity
10
+ expose :id
11
+ end
12
+
13
+ params do
14
+ optional :closed, type: Hash, documentation: { additional_properties: false, in: 'body' } do
15
+ requires :only
16
+ end
17
+ optional :open, type: Hash, documentation: { additional_properties: true }
18
+ optional :type_limited, type: Hash, documentation: { additional_properties: String }
19
+ optional :ref_limited, type: Hash, documentation: { additional_properties: Element }
20
+ optional :fallback, type: Hash, documentation: { additional_properties: { type: 'integer' } }
21
+ end
22
+ post do
23
+ present params
24
+ end
25
+ end
26
+
27
+ add_swagger_documentation format: :json, models: [Element]
28
+ end
29
+ end
30
+
31
+ subject do
32
+ get '/swagger_doc/things'
33
+ JSON.parse(last_response.body)
34
+ end
35
+
36
+ describe 'POST' do
37
+ specify do
38
+ expect(subject.dig('paths', '/things', 'post', 'parameters')).to eql(
39
+ [
40
+ { 'name' => 'postThings', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postThings' } }
41
+ ]
42
+ )
43
+ end
44
+
45
+ specify do
46
+ expect(subject.dig('definitions', 'postThings')).to eql(
47
+ 'type' => 'object',
48
+ 'properties' => {
49
+ 'closed' => {
50
+ 'type' => 'object',
51
+ 'additionalProperties' => false,
52
+ 'properties' => {
53
+ 'only' => { 'type' => 'string' }
54
+ },
55
+ 'required' => ['only']
56
+ },
57
+ 'open' => {
58
+ 'type' => 'object',
59
+ 'additionalProperties' => true
60
+ },
61
+ 'type_limited' => {
62
+ 'type' => 'object',
63
+ 'additionalProperties' => {
64
+ 'type' => 'string'
65
+ }
66
+ },
67
+ 'ref_limited' => {
68
+ 'type' => 'object',
69
+ 'additionalProperties' => {
70
+ '$ref' => '#/definitions/Element'
71
+ }
72
+ },
73
+ 'fallback' => {
74
+ 'type' => 'object',
75
+ 'additionalProperties' => {
76
+ 'type' => 'integer'
77
+ }
78
+ }
79
+ }
80
+ )
81
+ end
82
+ end
83
+ end
@@ -13,7 +13,7 @@ describe 'moving body/formData Params to definitions' do
13
13
  detail: 'more details description',
14
14
  success: Entities::UseNestedWithAddress
15
15
  params do
16
- optional :contact, type: Hash do
16
+ optional :contact, type: Hash, documentation: { additional_properties: true } do
17
17
  requires :name, type: String, documentation: { desc: 'name', in: 'body' }
18
18
  optional :addresses, type: Array do
19
19
  requires :street, type: String, documentation: { desc: 'street', in: 'body' }
@@ -96,6 +96,27 @@ describe 'moving body/formData Params to definitions' do
96
96
  end
97
97
  end
98
98
 
99
+ namespace :nested_params_array do
100
+ desc 'post in body with array of nested parameters',
101
+ detail: 'more details description',
102
+ success: Entities::UseNestedWithAddress
103
+ params do
104
+ optional :contacts, type: Array, documentation: { additional_properties: false } do
105
+ requires :name, type: String, documentation: { desc: 'name', in: 'body' }
106
+ optional :addresses, type: Array do
107
+ requires :street, type: String, documentation: { desc: 'street', in: 'body' }
108
+ requires :postcode, type: String, documentation: { desc: 'postcode', in: 'body' }
109
+ requires :city, type: String, documentation: { desc: 'city', in: 'body' }
110
+ optional :country, type: String, documentation: { desc: 'country', in: 'body' }
111
+ end
112
+ end
113
+ end
114
+
115
+ post '/in_body' do
116
+ { 'declared_params' => declared(params) }
117
+ end
118
+ end
119
+
99
120
  add_swagger_documentation
100
121
  end
101
122
  end
@@ -115,7 +136,7 @@ describe 'moving body/formData Params to definitions' do
115
136
  specify do
116
137
  expect(subject['paths']['/simple_nested_params/in_body']['post']['parameters']).to eql(
117
138
  [
118
- { 'name' => 'SimpleNestedParamsInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postSimpleNestedParamsInBody' } }
139
+ { 'name' => 'postSimpleNestedParamsInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postSimpleNestedParamsInBody' } }
119
140
  ]
120
141
  )
121
142
  end
@@ -126,6 +147,7 @@ describe 'moving body/formData Params to definitions' do
126
147
  'properties' => {
127
148
  'contact' => {
128
149
  'type' => 'object',
150
+ 'additionalProperties' => true,
129
151
  'properties' => {
130
152
  'name' => { 'type' => 'string', 'description' => 'name' },
131
153
  'addresses' => {
@@ -155,13 +177,13 @@ describe 'moving body/formData Params to definitions' do
155
177
  expect(subject['paths']['/simple_nested_params/in_body/{id}']['put']['parameters']).to eql(
156
178
  [
157
179
  { 'in' => 'path', 'name' => 'id', 'type' => 'integer', 'format' => 'int32', 'required' => true },
158
- { 'name' => 'SimpleNestedParamsInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putSimpleNestedParamsInBody' } }
180
+ { 'name' => 'putSimpleNestedParamsInBodyId', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putSimpleNestedParamsInBodyId' } }
159
181
  ]
160
182
  )
161
183
  end
162
184
 
163
185
  specify do
164
- expect(subject['definitions']['putSimpleNestedParamsInBody']).to eql(
186
+ expect(subject['definitions']['putSimpleNestedParamsInBodyId']).to eql(
165
187
  'type' => 'object',
166
188
  'properties' => {
167
189
  'name' => { 'type' => 'string', 'description' => 'name' },
@@ -192,7 +214,7 @@ describe 'moving body/formData Params to definitions' do
192
214
  expect(subject['paths']['/multiple_nested_params/in_body']['post']['parameters']).to eql(
193
215
  [
194
216
  {
195
- 'name' => 'MultipleNestedParamsInBody',
217
+ 'name' => 'postMultipleNestedParamsInBody',
196
218
  'in' => 'body',
197
219
  'required' => true,
198
220
  'schema' => { '$ref' => '#/definitions/postMultipleNestedParamsInBody' }
@@ -245,13 +267,13 @@ describe 'moving body/formData Params to definitions' do
245
267
  expect(subject['paths']['/multiple_nested_params/in_body/{id}']['put']['parameters']).to eql(
246
268
  [
247
269
  { 'in' => 'path', 'name' => 'id', 'type' => 'integer', 'format' => 'int32', 'required' => true },
248
- { 'name' => 'MultipleNestedParamsInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putMultipleNestedParamsInBody' } }
270
+ { 'name' => 'putMultipleNestedParamsInBodyId', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putMultipleNestedParamsInBodyId' } }
249
271
  ]
250
272
  )
251
273
  end
252
274
 
253
275
  specify do
254
- expect(subject['definitions']['putMultipleNestedParamsInBody']).to eql(
276
+ expect(subject['definitions']['putMultipleNestedParamsInBodyId']).to eql(
255
277
  'type' => 'object',
256
278
  'properties' => {
257
279
  'name' => { 'type' => 'string', 'description' => 'name' },
@@ -280,4 +302,54 @@ describe 'moving body/formData Params to definitions' do
280
302
  end
281
303
  end
282
304
  end
305
+
306
+ describe 'array of nested body parameters given' do
307
+ subject do
308
+ get '/swagger_doc/nested_params_array'
309
+ JSON.parse(last_response.body)
310
+ end
311
+
312
+ describe 'POST' do
313
+ specify do
314
+ expect(subject['paths']['/nested_params_array/in_body']['post']['parameters']).to eql(
315
+ [
316
+ { 'name' => 'postNestedParamsArrayInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postNestedParamsArrayInBody' } }
317
+ ]
318
+ )
319
+ end
320
+
321
+ specify do
322
+ expect(subject['definitions']['postNestedParamsArrayInBody']).to eql(
323
+ 'type' => 'object',
324
+ 'properties' => {
325
+ 'contacts' => {
326
+ 'type' => 'array',
327
+ 'items' => {
328
+ 'type' => 'object',
329
+ 'additionalProperties' => false,
330
+ 'properties' => {
331
+ 'name' => { 'type' => 'string', 'description' => 'name' },
332
+ 'addresses' => {
333
+ 'type' => 'array',
334
+ 'items' => {
335
+ 'type' => 'object',
336
+ 'properties' => {
337
+ 'street' => { 'type' => 'string', 'description' => 'street' },
338
+ 'postcode' => { 'type' => 'string', 'description' => 'postcode' },
339
+ 'city' => { 'type' => 'string', 'description' => 'city' },
340
+ 'country' => { 'type' => 'string', 'description' => 'country' }
341
+ },
342
+ 'required' => %w[street postcode city]
343
+ }
344
+ }
345
+ },
346
+ 'required' => %w[name]
347
+ }
348
+ }
349
+ },
350
+ 'description' => 'post in body with array of nested parameters'
351
+ )
352
+ end
353
+ end
354
+ end
283
355
  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' => {
@@ -9,6 +9,7 @@ describe 'Boolean Params' do
9
9
 
10
10
  params do
11
11
  requires :a_boolean, type: Grape::API::Boolean
12
+ optional :another_boolean, type: Grape::API::Boolean, default: false
12
13
  end
13
14
  post :splines do
14
15
  { message: 'hi' }
@@ -27,7 +28,8 @@ describe 'Boolean Params' do
27
28
 
28
29
  it 'converts boolean types' do
29
30
  expect(subject).to eq [
30
- { 'in' => 'formData', 'name' => 'a_boolean', 'type' => 'boolean', 'required' => true }
31
+ { 'in' => 'formData', 'name' => 'a_boolean', 'type' => 'boolean', 'required' => true },
32
+ { 'in' => 'formData', 'name' => 'another_boolean', 'type' => 'boolean', 'required' => false, 'default' => false }
31
33
  ]
32
34
  end
33
35
  end
@@ -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.0
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-03-19 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"
@@ -102,6 +101,8 @@ files:
102
101
  - spec/issues/776_multiple_presents_spec.rb
103
102
  - spec/issues/784_extensions_on_params_spec.rb
104
103
  - spec/issues/809_utf8_routes_spec.rb
104
+ - spec/issues/832_array_hash_float_decimal_spec.rb
105
+ - spec/issues/847_route_param_options_spec.rb
105
106
  - spec/lib/data_type_spec.rb
106
107
  - spec/lib/endpoint/params_parser_spec.rb
107
108
  - spec/lib/endpoint_spec.rb
@@ -127,6 +128,7 @@ files:
127
128
  - spec/support/namespace_tags.rb
128
129
  - spec/support/the_paths_definitions.rb
129
130
  - spec/swagger_v2/api_documentation_spec.rb
131
+ - spec/swagger_v2/api_swagger_v2_additional_properties_spec.rb
130
132
  - spec/swagger_v2/api_swagger_v2_body_definitions_spec.rb
131
133
  - spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
132
134
  - spec/swagger_v2/api_swagger_v2_detail_spec.rb
@@ -187,7 +189,8 @@ files:
187
189
  homepage: https://github.com/ruby-grape/grape-swagger
188
190
  licenses:
189
191
  - MIT
190
- metadata: {}
192
+ metadata:
193
+ rubygems_mfa_required: 'true'
191
194
  post_install_message:
192
195
  rdoc_options: []
193
196
  require_paths:
@@ -196,119 +199,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
196
199
  requirements:
197
200
  - - ">="
198
201
  - !ruby/object:Gem::Version
199
- version: '2.5'
202
+ version: '2.7'
200
203
  required_rubygems_version: !ruby/object:Gem::Requirement
201
204
  requirements:
202
205
  - - ">="
203
206
  - !ruby/object:Gem::Version
204
207
  version: '0'
205
208
  requirements: []
206
- rubygems_version: 3.2.3
209
+ rubygems_version: 3.3.7
207
210
  signing_key:
208
211
  specification_version: 4
209
212
  summary: Add auto generated documentation to your Grape API that can be displayed
210
213
  with Swagger.
211
- test_files:
212
- - spec/issues/267_nested_namespaces.rb
213
- - spec/issues/403_versions_spec.rb
214
- - spec/issues/427_entity_as_string_spec.rb
215
- - spec/issues/430_entity_definitions_spec.rb
216
- - spec/issues/532_allow_custom_format_spec.rb
217
- - spec/issues/533_specify_status_code_spec.rb
218
- - spec/issues/537_enum_values_spec.rb
219
- - spec/issues/539_array_post_body_spec.rb
220
- - spec/issues/542_array_of_type_in_post_body_spec.rb
221
- - spec/issues/553_align_array_put_post_params_spec.rb
222
- - spec/issues/572_array_post_body_spec.rb
223
- - spec/issues/579_align_put_post_parameters_spec.rb
224
- - spec/issues/582_file_response_spec.rb
225
- - spec/issues/587_range_parameter_delimited_by_dash_spec.rb
226
- - spec/issues/605_root_route_documentation_spec.rb
227
- - spec/issues/650_params_array_spec.rb
228
- - spec/issues/680_keep_204_error_schemas_spec.rb
229
- - spec/issues/751_deeply_nested_objects_spec.rb
230
- - spec/issues/776_multiple_presents_spec.rb
231
- - spec/issues/784_extensions_on_params_spec.rb
232
- - spec/issues/809_utf8_routes_spec.rb
233
- - spec/lib/data_type_spec.rb
234
- - spec/lib/endpoint/params_parser_spec.rb
235
- - spec/lib/endpoint_spec.rb
236
- - spec/lib/extensions_spec.rb
237
- - spec/lib/format_data_spec.rb
238
- - spec/lib/model_parsers_spec.rb
239
- - spec/lib/move_params_spec.rb
240
- - spec/lib/oapi_tasks_spec.rb
241
- - spec/lib/operation_id_spec.rb
242
- - spec/lib/optional_object_spec.rb
243
- - spec/lib/parse_params_spec.rb
244
- - spec/lib/path_string_spec.rb
245
- - spec/lib/produces_consumes_spec.rb
246
- - spec/lib/tag_name_description_spec.rb
247
- - spec/lib/version_spec.rb
248
- - spec/spec_helper.rb
249
- - spec/support/empty_model_parser.rb
250
- - spec/support/grape_version.rb
251
- - spec/support/mock_parser.rb
252
- - spec/support/model_parsers/entity_parser.rb
253
- - spec/support/model_parsers/mock_parser.rb
254
- - spec/support/model_parsers/representable_parser.rb
255
- - spec/support/namespace_tags.rb
256
- - spec/support/the_paths_definitions.rb
257
- - spec/swagger_v2/api_documentation_spec.rb
258
- - spec/swagger_v2/api_swagger_v2_body_definitions_spec.rb
259
- - spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
260
- - spec/swagger_v2/api_swagger_v2_detail_spec.rb
261
- - spec/swagger_v2/api_swagger_v2_extensions_spec.rb
262
- - spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb
263
- - spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb
264
- - spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb
265
- - spec/swagger_v2/api_swagger_v2_headers_spec.rb
266
- - spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb
267
- - spec/swagger_v2/api_swagger_v2_hide_param_spec.rb
268
- - spec/swagger_v2/api_swagger_v2_ignore_defaults_spec.rb
269
- - spec/swagger_v2/api_swagger_v2_mounted_spec.rb
270
- - spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb
271
- - spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb
272
- - spec/swagger_v2/api_swagger_v2_param_type_spec.rb
273
- - spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb
274
- - spec/swagger_v2/api_swagger_v2_response_spec.rb
275
- - spec/swagger_v2/api_swagger_v2_response_with_examples_spec.rb
276
- - spec/swagger_v2/api_swagger_v2_response_with_headers_spec.rb
277
- - spec/swagger_v2/api_swagger_v2_response_with_models_spec.rb
278
- - spec/swagger_v2/api_swagger_v2_response_with_root_spec.rb
279
- - spec/swagger_v2/api_swagger_v2_spec.rb
280
- - spec/swagger_v2/api_swagger_v2_status_codes_spec.rb
281
- - spec/swagger_v2/api_swagger_v2_type-format_spec.rb
282
- - spec/swagger_v2/boolean_params_spec.rb
283
- - spec/swagger_v2/default_api_spec.rb
284
- - spec/swagger_v2/deprecated_field_spec.rb
285
- - spec/swagger_v2/description_not_initialized_spec.rb
286
- - spec/swagger_v2/endpoint_versioned_path_spec.rb
287
- - spec/swagger_v2/errors_spec.rb
288
- - spec/swagger_v2/float_api_spec.rb
289
- - spec/swagger_v2/form_params_spec.rb
290
- - spec/swagger_v2/grape-swagger_spec.rb
291
- - spec/swagger_v2/guarded_endpoint_spec.rb
292
- - spec/swagger_v2/hide_api_spec.rb
293
- - spec/swagger_v2/host_spec.rb
294
- - spec/swagger_v2/inheritance_and_discriminator_spec.rb
295
- - spec/swagger_v2/mount_override_api_spec.rb
296
- - spec/swagger_v2/mounted_target_class_spec.rb
297
- - spec/swagger_v2/namespace_tags_prefix_spec.rb
298
- - spec/swagger_v2/namespace_tags_spec.rb
299
- - spec/swagger_v2/namespaced_api_spec.rb
300
- - spec/swagger_v2/nicknamed_api_spec.rb
301
- - spec/swagger_v2/operation_id_api_spec.rb
302
- - spec/swagger_v2/param_multi_type_spec.rb
303
- - spec/swagger_v2/param_type_spec.rb
304
- - spec/swagger_v2/param_values_spec.rb
305
- - spec/swagger_v2/params_array_collection_format_spec.rb
306
- - spec/swagger_v2/params_array_spec.rb
307
- - spec/swagger_v2/params_example_spec.rb
308
- - spec/swagger_v2/params_hash_spec.rb
309
- - spec/swagger_v2/params_nested_spec.rb
310
- - spec/swagger_v2/parent_less_namespace_spec.rb
311
- - spec/swagger_v2/reference_entity_spec.rb
312
- - spec/swagger_v2/security_requirement_spec.rb
313
- - spec/swagger_v2/simple_mounted_api_spec.rb
314
- - 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,32 +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']
17
- grape-version: [1.5.3, 1.4.0, 1.3.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
31
- - name: Run rubocop
32
- run: bundle exec rubocop