grape-swagger 1.2.1 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +14 -0
  3. data/.github/workflows/rubocop.yml +26 -0
  4. data/.github/workflows/ruby.yml +32 -0
  5. data/.rubocop.yml +15 -4
  6. data/.rubocop_todo.yml +1 -1
  7. data/CHANGELOG.md +37 -0
  8. data/Gemfile +2 -2
  9. data/README.md +84 -3
  10. data/UPGRADING.md +8 -0
  11. data/grape-swagger.gemspec +3 -3
  12. data/lib/grape-swagger/doc_methods/format_data.rb +2 -2
  13. data/lib/grape-swagger/doc_methods/move_params.rb +1 -1
  14. data/lib/grape-swagger/doc_methods/parse_params.rb +6 -0
  15. data/lib/grape-swagger/doc_methods.rb +65 -62
  16. data/lib/grape-swagger/endpoint.rb +55 -15
  17. data/lib/grape-swagger/errors.rb +2 -0
  18. data/lib/grape-swagger/model_parsers.rb +2 -2
  19. data/lib/grape-swagger/rake/oapi_tasks.rb +2 -0
  20. data/lib/grape-swagger/version.rb +1 -1
  21. data/lib/grape-swagger.rb +5 -2
  22. data/spec/issues/537_enum_values_spec.rb +1 -0
  23. data/spec/issues/776_multiple_presents_spec.rb +59 -0
  24. data/spec/issues/809_utf8_routes_spec.rb +55 -0
  25. data/spec/lib/format_data_spec.rb +24 -0
  26. data/spec/lib/move_params_spec.rb +2 -2
  27. data/spec/spec_helper.rb +1 -1
  28. data/spec/support/empty_model_parser.rb +2 -0
  29. data/spec/support/model_parsers/entity_parser.rb +8 -8
  30. data/spec/support/model_parsers/mock_parser.rb +24 -8
  31. data/spec/support/model_parsers/representable_parser.rb +8 -8
  32. data/spec/support/namespace_tags.rb +3 -0
  33. data/spec/support/the_paths_definitions.rb +4 -4
  34. data/spec/swagger_v2/api_swagger_v2_mounted_spec.rb +1 -0
  35. data/spec/swagger_v2/api_swagger_v2_response_with_headers_spec.rb +4 -2
  36. data/spec/swagger_v2/api_swagger_v2_response_with_models_spec.rb +53 -0
  37. data/spec/swagger_v2/api_swagger_v2_spec.rb +1 -0
  38. data/spec/swagger_v2/boolean_params_spec.rb +1 -0
  39. data/spec/swagger_v2/float_api_spec.rb +1 -0
  40. data/spec/swagger_v2/inheritance_and_discriminator_spec.rb +1 -0
  41. data/spec/swagger_v2/namespace_tags_prefix_spec.rb +1 -0
  42. data/spec/swagger_v2/param_multi_type_spec.rb +2 -0
  43. data/spec/swagger_v2/param_type_spec.rb +3 -0
  44. data/spec/swagger_v2/param_values_spec.rb +6 -0
  45. data/spec/swagger_v2/{params_array_collection_fromat_spec.rb → params_array_collection_format_spec.rb} +0 -0
  46. data/spec/swagger_v2/params_example_spec.rb +40 -0
  47. data/spec/swagger_v2/reference_entity_spec.rb +2 -2
  48. data/spec/swagger_v2/simple_mounted_api_spec.rb +3 -0
  49. metadata +19 -7
  50. data/.travis.yml +0 -36
@@ -103,7 +103,7 @@ describe 'referenceEntity' do
103
103
  'description' => 'Something interesting.'
104
104
  }
105
105
  },
106
- 'description' => 'This returns kind and something or an error'
106
+ 'description' => 'KindCustom model'
107
107
  )
108
108
  end
109
109
  end
@@ -122,7 +122,7 @@ describe 'referenceEntity' do
122
122
  'title' => { 'type' => 'string', 'description' => 'Title of the parent.' },
123
123
  'child' => { 'type' => 'string', 'description' => 'Child property.' }
124
124
  },
125
- 'description' => 'This returns a child entity'
125
+ 'description' => 'MyAPI::Child model'
126
126
  )
127
127
  end
128
128
  end
@@ -4,11 +4,14 @@ require 'spec_helper'
4
4
 
5
5
  describe 'a simple mounted api' do
6
6
  before :all do
7
+ # rubocop:disable Lint/EmptyClass
7
8
  class CustomType; end
9
+ # rubocop:enable Lint/EmptyClass
8
10
 
9
11
  class SimpleMountedApi < Grape::API
10
12
  desc 'Document root'
11
13
  get do
14
+ { message: 'hi' }
12
15
  end
13
16
 
14
17
  desc 'This gets something.',
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-swagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
+ - LeFnord
7
8
  - Tim Vandecasteele
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2020-07-15 00:00:00.000000000 Z
12
+ date: 2021-09-15 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: grape
@@ -26,18 +27,21 @@ dependencies:
26
27
  version: '1.3'
27
28
  description:
28
29
  email:
30
+ - pscholz.le@gmail.com
29
31
  - tim.vandecasteele@gmail.com
30
32
  executables: []
31
33
  extensions: []
32
34
  extra_rdoc_files: []
33
35
  files:
34
36
  - ".coveralls.yml"
37
+ - ".github/dependabot.yml"
38
+ - ".github/workflows/rubocop.yml"
39
+ - ".github/workflows/ruby.yml"
35
40
  - ".gitignore"
36
41
  - ".rspec"
37
42
  - ".rubocop.yml"
38
43
  - ".rubocop_todo.yml"
39
44
  - ".ruby-gemset"
40
- - ".travis.yml"
41
45
  - CHANGELOG.md
42
46
  - CONTRIBUTING.md
43
47
  - Dangerfile
@@ -95,7 +99,9 @@ files:
95
99
  - spec/issues/650_params_array_spec.rb
96
100
  - spec/issues/680_keep_204_error_schemas_spec.rb
97
101
  - spec/issues/751_deeply_nested_objects_spec.rb
102
+ - spec/issues/776_multiple_presents_spec.rb
98
103
  - spec/issues/784_extensions_on_params_spec.rb
104
+ - spec/issues/809_utf8_routes_spec.rb
99
105
  - spec/lib/data_type_spec.rb
100
106
  - spec/lib/endpoint/params_parser_spec.rb
101
107
  - spec/lib/endpoint_spec.rb
@@ -140,6 +146,7 @@ files:
140
146
  - spec/swagger_v2/api_swagger_v2_response_spec.rb
141
147
  - spec/swagger_v2/api_swagger_v2_response_with_examples_spec.rb
142
148
  - spec/swagger_v2/api_swagger_v2_response_with_headers_spec.rb
149
+ - spec/swagger_v2/api_swagger_v2_response_with_models_spec.rb
143
150
  - spec/swagger_v2/api_swagger_v2_response_with_root_spec.rb
144
151
  - spec/swagger_v2/api_swagger_v2_spec.rb
145
152
  - spec/swagger_v2/api_swagger_v2_status_codes_spec.rb
@@ -167,8 +174,9 @@ files:
167
174
  - spec/swagger_v2/param_multi_type_spec.rb
168
175
  - spec/swagger_v2/param_type_spec.rb
169
176
  - spec/swagger_v2/param_values_spec.rb
170
- - spec/swagger_v2/params_array_collection_fromat_spec.rb
177
+ - spec/swagger_v2/params_array_collection_format_spec.rb
171
178
  - spec/swagger_v2/params_array_spec.rb
179
+ - spec/swagger_v2/params_example_spec.rb
172
180
  - spec/swagger_v2/params_hash_spec.rb
173
181
  - spec/swagger_v2/params_nested_spec.rb
174
182
  - spec/swagger_v2/parent_less_namespace_spec.rb
@@ -188,14 +196,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
196
  requirements:
189
197
  - - ">="
190
198
  - !ruby/object:Gem::Version
191
- version: '2.4'
199
+ version: '2.5'
192
200
  required_rubygems_version: !ruby/object:Gem::Requirement
193
201
  requirements:
194
202
  - - ">="
195
203
  - !ruby/object:Gem::Version
196
204
  version: '0'
197
205
  requirements: []
198
- rubygems_version: 3.1.4
206
+ rubygems_version: 3.2.22
199
207
  signing_key:
200
208
  specification_version: 4
201
209
  summary: Add auto generated documentation to your Grape API that can be displayed
@@ -219,7 +227,9 @@ test_files:
219
227
  - spec/issues/650_params_array_spec.rb
220
228
  - spec/issues/680_keep_204_error_schemas_spec.rb
221
229
  - spec/issues/751_deeply_nested_objects_spec.rb
230
+ - spec/issues/776_multiple_presents_spec.rb
222
231
  - spec/issues/784_extensions_on_params_spec.rb
232
+ - spec/issues/809_utf8_routes_spec.rb
223
233
  - spec/lib/data_type_spec.rb
224
234
  - spec/lib/endpoint/params_parser_spec.rb
225
235
  - spec/lib/endpoint_spec.rb
@@ -264,6 +274,7 @@ test_files:
264
274
  - spec/swagger_v2/api_swagger_v2_response_spec.rb
265
275
  - spec/swagger_v2/api_swagger_v2_response_with_examples_spec.rb
266
276
  - spec/swagger_v2/api_swagger_v2_response_with_headers_spec.rb
277
+ - spec/swagger_v2/api_swagger_v2_response_with_models_spec.rb
267
278
  - spec/swagger_v2/api_swagger_v2_response_with_root_spec.rb
268
279
  - spec/swagger_v2/api_swagger_v2_spec.rb
269
280
  - spec/swagger_v2/api_swagger_v2_status_codes_spec.rb
@@ -291,8 +302,9 @@ test_files:
291
302
  - spec/swagger_v2/param_multi_type_spec.rb
292
303
  - spec/swagger_v2/param_type_spec.rb
293
304
  - spec/swagger_v2/param_values_spec.rb
294
- - spec/swagger_v2/params_array_collection_fromat_spec.rb
305
+ - spec/swagger_v2/params_array_collection_format_spec.rb
295
306
  - spec/swagger_v2/params_array_spec.rb
307
+ - spec/swagger_v2/params_example_spec.rb
296
308
  - spec/swagger_v2/params_hash_spec.rb
297
309
  - spec/swagger_v2/params_nested_spec.rb
298
310
  - spec/swagger_v2/parent_less_namespace_spec.rb
data/.travis.yml DELETED
@@ -1,36 +0,0 @@
1
- language: ruby
2
-
3
- os: linux
4
-
5
- before_install:
6
- - gem install bundler
7
-
8
- after_success:
9
- - bundle exec danger
10
-
11
- rvm:
12
- - 2.5.8
13
- - 2.6.6
14
- - 2.7.1
15
- env:
16
- - GRAPE_VERSION=1.3.3
17
- - GRAPE_VERSION=1.4.0 MODEL_PARSER=grape-swagger-entity
18
- - GRAPE_VERSION=1.4.0 MODEL_PARSER=grape-swagger-representable
19
- - GRAPE_VERSION=1.4.0
20
- - GRAPE_VERSION=HEAD
21
-
22
- jobs:
23
- fast_finish: true
24
-
25
- include:
26
- - rvm: 2.4.10
27
- env:
28
- - rvm: ruby-head
29
- env:
30
- - rvm: jruby-head
31
- env:
32
-
33
- allow_failures:
34
- - rvm: 2.4.10
35
- - rvm: ruby-head
36
- - rvm: jruby-head