gitlab-grape-swagger 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.github/dependabot.yml +20 -0
  4. data/.github/workflows/ci.yml +45 -0
  5. data/.gitignore +44 -0
  6. data/.gitlab-ci.yml +19 -0
  7. data/.rspec +3 -0
  8. data/.rubocop.yml +136 -0
  9. data/.rubocop_todo.yml +60 -0
  10. data/.ruby-gemset +1 -0
  11. data/CHANGELOG.md +671 -0
  12. data/CONTRIBUTING.md +126 -0
  13. data/Dangerfile +3 -0
  14. data/Gemfile +45 -0
  15. data/Gemfile.lock +249 -0
  16. data/LICENSE.txt +20 -0
  17. data/README.md +1772 -0
  18. data/RELEASING.md +82 -0
  19. data/Rakefile +20 -0
  20. data/UPGRADING.md +201 -0
  21. data/example/api/endpoints.rb +131 -0
  22. data/example/api/entities.rb +18 -0
  23. data/example/config.ru +42 -0
  24. data/example/example_requests.postman_collection +146 -0
  25. data/example/splines.png +0 -0
  26. data/example/swagger-example.png +0 -0
  27. data/grape-swagger.gemspec +23 -0
  28. data/lib/grape-swagger/doc_methods/build_model_definition.rb +68 -0
  29. data/lib/grape-swagger/doc_methods/data_type.rb +110 -0
  30. data/lib/grape-swagger/doc_methods/extensions.rb +101 -0
  31. data/lib/grape-swagger/doc_methods/file_params.rb +17 -0
  32. data/lib/grape-swagger/doc_methods/format_data.rb +53 -0
  33. data/lib/grape-swagger/doc_methods/headers.rb +20 -0
  34. data/lib/grape-swagger/doc_methods/move_params.rb +209 -0
  35. data/lib/grape-swagger/doc_methods/operation_id.rb +32 -0
  36. data/lib/grape-swagger/doc_methods/optional_object.rb +30 -0
  37. data/lib/grape-swagger/doc_methods/parse_params.rb +190 -0
  38. data/lib/grape-swagger/doc_methods/path_string.rb +52 -0
  39. data/lib/grape-swagger/doc_methods/produces_consumes.rb +15 -0
  40. data/lib/grape-swagger/doc_methods/status_codes.rb +21 -0
  41. data/lib/grape-swagger/doc_methods/tag_name_description.rb +34 -0
  42. data/lib/grape-swagger/doc_methods/version.rb +20 -0
  43. data/lib/grape-swagger/doc_methods.rb +142 -0
  44. data/lib/grape-swagger/endpoint/params_parser.rb +76 -0
  45. data/lib/grape-swagger/endpoint.rb +476 -0
  46. data/lib/grape-swagger/errors.rb +17 -0
  47. data/lib/grape-swagger/instance.rb +7 -0
  48. data/lib/grape-swagger/model_parsers.rb +42 -0
  49. data/lib/grape-swagger/rake/oapi_tasks.rb +135 -0
  50. data/lib/grape-swagger/version.rb +5 -0
  51. data/lib/grape-swagger.rb +174 -0
  52. data/spec/issues/267_nested_namespaces.rb +55 -0
  53. data/spec/issues/403_versions_spec.rb +124 -0
  54. data/spec/issues/427_entity_as_string_spec.rb +39 -0
  55. data/spec/issues/430_entity_definitions_spec.rb +94 -0
  56. data/spec/issues/532_allow_custom_format_spec.rb +42 -0
  57. data/spec/issues/533_specify_status_code_spec.rb +78 -0
  58. data/spec/issues/537_enum_values_spec.rb +50 -0
  59. data/spec/issues/539_array_post_body_spec.rb +65 -0
  60. data/spec/issues/542_array_of_type_in_post_body_spec.rb +46 -0
  61. data/spec/issues/553_align_array_put_post_params_spec.rb +152 -0
  62. data/spec/issues/572_array_post_body_spec.rb +51 -0
  63. data/spec/issues/579_align_put_post_parameters_spec.rb +185 -0
  64. data/spec/issues/582_file_response_spec.rb +55 -0
  65. data/spec/issues/587_range_parameter_delimited_by_dash_spec.rb +26 -0
  66. data/spec/issues/605_root_route_documentation_spec.rb +23 -0
  67. data/spec/issues/650_params_array_spec.rb +65 -0
  68. data/spec/issues/677_consumes_produces_add_swagger_documentation_options_spec.rb +100 -0
  69. data/spec/issues/680_keep_204_error_schemas_spec.rb +55 -0
  70. data/spec/issues/721_set_default_parameter_location_based_on_consumes_spec.rb +62 -0
  71. data/spec/issues/751_deeply_nested_objects_spec.rb +190 -0
  72. data/spec/issues/776_multiple_presents_spec.rb +59 -0
  73. data/spec/issues/784_extensions_on_params_spec.rb +42 -0
  74. data/spec/issues/809_utf8_routes_spec.rb +55 -0
  75. data/spec/issues/832_array_hash_float_decimal_spec.rb +114 -0
  76. data/spec/issues/847_route_param_options_spec.rb +37 -0
  77. data/spec/issues/873_wildcard_segments_path_parameters_spec.rb +28 -0
  78. data/spec/issues/878_optional_path_segments_spec.rb +29 -0
  79. data/spec/issues/881_handle_file_params_spec.rb +38 -0
  80. data/spec/issues/883_query_array_parameter_spec.rb +46 -0
  81. data/spec/issues/884_dont_document_non_schema_examples_spec.rb +49 -0
  82. data/spec/issues/887_prevent_duplicate_operation_ids_spec.rb +35 -0
  83. data/spec/lib/data_type_spec.rb +111 -0
  84. data/spec/lib/endpoint/params_parser_spec.rb +124 -0
  85. data/spec/lib/endpoint_spec.rb +153 -0
  86. data/spec/lib/extensions_spec.rb +185 -0
  87. data/spec/lib/format_data_spec.rb +115 -0
  88. data/spec/lib/model_parsers_spec.rb +104 -0
  89. data/spec/lib/move_params_spec.rb +444 -0
  90. data/spec/lib/oapi_tasks_spec.rb +163 -0
  91. data/spec/lib/operation_id_spec.rb +55 -0
  92. data/spec/lib/optional_object_spec.rb +47 -0
  93. data/spec/lib/parse_params_spec.rb +68 -0
  94. data/spec/lib/path_string_spec.rb +101 -0
  95. data/spec/lib/produces_consumes_spec.rb +116 -0
  96. data/spec/lib/tag_name_description_spec.rb +80 -0
  97. data/spec/lib/version_spec.rb +28 -0
  98. data/spec/spec_helper.rb +39 -0
  99. data/spec/support/empty_model_parser.rb +23 -0
  100. data/spec/support/grape_version.rb +13 -0
  101. data/spec/support/mock_parser.rb +23 -0
  102. data/spec/support/model_parsers/entity_parser.rb +334 -0
  103. data/spec/support/model_parsers/mock_parser.rb +346 -0
  104. data/spec/support/model_parsers/representable_parser.rb +406 -0
  105. data/spec/support/namespace_tags.rb +93 -0
  106. data/spec/support/the_paths_definitions.rb +109 -0
  107. data/spec/swagger_v2/api_documentation_spec.rb +42 -0
  108. data/spec/swagger_v2/api_swagger_v2_additional_properties_spec.rb +83 -0
  109. data/spec/swagger_v2/api_swagger_v2_body_definitions_spec.rb +48 -0
  110. data/spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb +36 -0
  111. data/spec/swagger_v2/api_swagger_v2_detail_spec.rb +79 -0
  112. data/spec/swagger_v2/api_swagger_v2_extensions_spec.rb +145 -0
  113. data/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb +137 -0
  114. data/spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb +56 -0
  115. data/spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb +64 -0
  116. data/spec/swagger_v2/api_swagger_v2_headers_spec.rb +58 -0
  117. data/spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb +57 -0
  118. data/spec/swagger_v2/api_swagger_v2_hide_param_spec.rb +109 -0
  119. data/spec/swagger_v2/api_swagger_v2_ignore_defaults_spec.rb +48 -0
  120. data/spec/swagger_v2/api_swagger_v2_mounted_spec.rb +153 -0
  121. data/spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb +355 -0
  122. data/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb +217 -0
  123. data/spec/swagger_v2/api_swagger_v2_param_type_spec.rb +247 -0
  124. data/spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb +80 -0
  125. data/spec/swagger_v2/api_swagger_v2_response_spec.rb +147 -0
  126. data/spec/swagger_v2/api_swagger_v2_response_with_examples_spec.rb +135 -0
  127. data/spec/swagger_v2/api_swagger_v2_response_with_headers_spec.rb +216 -0
  128. data/spec/swagger_v2/api_swagger_v2_response_with_models_spec.rb +53 -0
  129. data/spec/swagger_v2/api_swagger_v2_response_with_root_spec.rb +153 -0
  130. data/spec/swagger_v2/api_swagger_v2_spec.rb +245 -0
  131. data/spec/swagger_v2/api_swagger_v2_status_codes_spec.rb +93 -0
  132. data/spec/swagger_v2/api_swagger_v2_type-format_spec.rb +90 -0
  133. data/spec/swagger_v2/boolean_params_spec.rb +38 -0
  134. data/spec/swagger_v2/default_api_spec.rb +175 -0
  135. data/spec/swagger_v2/deprecated_field_spec.rb +25 -0
  136. data/spec/swagger_v2/description_not_initialized_spec.rb +39 -0
  137. data/spec/swagger_v2/endpoint_versioned_path_spec.rb +130 -0
  138. data/spec/swagger_v2/errors_spec.rb +77 -0
  139. data/spec/swagger_v2/float_api_spec.rb +36 -0
  140. data/spec/swagger_v2/form_params_spec.rb +76 -0
  141. data/spec/swagger_v2/grape-swagger_spec.rb +17 -0
  142. data/spec/swagger_v2/guarded_endpoint_spec.rb +162 -0
  143. data/spec/swagger_v2/hide_api_spec.rb +147 -0
  144. data/spec/swagger_v2/host_spec.rb +43 -0
  145. data/spec/swagger_v2/inheritance_and_discriminator_spec.rb +57 -0
  146. data/spec/swagger_v2/mount_override_api_spec.rb +58 -0
  147. data/spec/swagger_v2/mounted_target_class_spec.rb +76 -0
  148. data/spec/swagger_v2/namespace_tags_prefix_spec.rb +122 -0
  149. data/spec/swagger_v2/namespace_tags_spec.rb +78 -0
  150. data/spec/swagger_v2/namespaced_api_spec.rb +121 -0
  151. data/spec/swagger_v2/nicknamed_api_spec.rb +25 -0
  152. data/spec/swagger_v2/operation_id_api_spec.rb +27 -0
  153. data/spec/swagger_v2/param_multi_type_spec.rb +82 -0
  154. data/spec/swagger_v2/param_type_spec.rb +95 -0
  155. data/spec/swagger_v2/param_values_spec.rb +180 -0
  156. data/spec/swagger_v2/params_array_collection_format_spec.rb +105 -0
  157. data/spec/swagger_v2/params_array_spec.rb +225 -0
  158. data/spec/swagger_v2/params_example_spec.rb +38 -0
  159. data/spec/swagger_v2/params_hash_spec.rb +77 -0
  160. data/spec/swagger_v2/params_nested_spec.rb +92 -0
  161. data/spec/swagger_v2/parent_less_namespace_spec.rb +32 -0
  162. data/spec/swagger_v2/reference_entity_spec.rb +129 -0
  163. data/spec/swagger_v2/security_requirement_spec.rb +46 -0
  164. data/spec/swagger_v2/simple_mounted_api_spec.rb +332 -0
  165. data/spec/version_spec.rb +10 -0
  166. metadata +225 -0
metadata ADDED
@@ -0,0 +1,225 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gitlab-grape-swagger
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.5.0
5
+ platform: ruby
6
+ authors:
7
+ - LeFnord
8
+ - Tim Vandecasteele
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2022-12-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: grape
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.3'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.3'
28
+ description:
29
+ email:
30
+ - pscholz.le@gmail.com
31
+ - tim.vandecasteele@gmail.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - ".coveralls.yml"
37
+ - ".github/dependabot.yml"
38
+ - ".github/workflows/ci.yml"
39
+ - ".gitignore"
40
+ - ".gitlab-ci.yml"
41
+ - ".rspec"
42
+ - ".rubocop.yml"
43
+ - ".rubocop_todo.yml"
44
+ - ".ruby-gemset"
45
+ - CHANGELOG.md
46
+ - CONTRIBUTING.md
47
+ - Dangerfile
48
+ - Gemfile
49
+ - Gemfile.lock
50
+ - LICENSE.txt
51
+ - README.md
52
+ - RELEASING.md
53
+ - Rakefile
54
+ - UPGRADING.md
55
+ - example/api/endpoints.rb
56
+ - example/api/entities.rb
57
+ - example/config.ru
58
+ - example/example_requests.postman_collection
59
+ - example/splines.png
60
+ - example/swagger-example.png
61
+ - grape-swagger.gemspec
62
+ - lib/grape-swagger.rb
63
+ - lib/grape-swagger/doc_methods.rb
64
+ - lib/grape-swagger/doc_methods/build_model_definition.rb
65
+ - lib/grape-swagger/doc_methods/data_type.rb
66
+ - lib/grape-swagger/doc_methods/extensions.rb
67
+ - lib/grape-swagger/doc_methods/file_params.rb
68
+ - lib/grape-swagger/doc_methods/format_data.rb
69
+ - lib/grape-swagger/doc_methods/headers.rb
70
+ - lib/grape-swagger/doc_methods/move_params.rb
71
+ - lib/grape-swagger/doc_methods/operation_id.rb
72
+ - lib/grape-swagger/doc_methods/optional_object.rb
73
+ - lib/grape-swagger/doc_methods/parse_params.rb
74
+ - lib/grape-swagger/doc_methods/path_string.rb
75
+ - lib/grape-swagger/doc_methods/produces_consumes.rb
76
+ - lib/grape-swagger/doc_methods/status_codes.rb
77
+ - lib/grape-swagger/doc_methods/tag_name_description.rb
78
+ - lib/grape-swagger/doc_methods/version.rb
79
+ - lib/grape-swagger/endpoint.rb
80
+ - lib/grape-swagger/endpoint/params_parser.rb
81
+ - lib/grape-swagger/errors.rb
82
+ - lib/grape-swagger/instance.rb
83
+ - lib/grape-swagger/model_parsers.rb
84
+ - lib/grape-swagger/rake/oapi_tasks.rb
85
+ - lib/grape-swagger/version.rb
86
+ - spec/issues/267_nested_namespaces.rb
87
+ - spec/issues/403_versions_spec.rb
88
+ - spec/issues/427_entity_as_string_spec.rb
89
+ - spec/issues/430_entity_definitions_spec.rb
90
+ - spec/issues/532_allow_custom_format_spec.rb
91
+ - spec/issues/533_specify_status_code_spec.rb
92
+ - spec/issues/537_enum_values_spec.rb
93
+ - spec/issues/539_array_post_body_spec.rb
94
+ - spec/issues/542_array_of_type_in_post_body_spec.rb
95
+ - spec/issues/553_align_array_put_post_params_spec.rb
96
+ - spec/issues/572_array_post_body_spec.rb
97
+ - spec/issues/579_align_put_post_parameters_spec.rb
98
+ - spec/issues/582_file_response_spec.rb
99
+ - spec/issues/587_range_parameter_delimited_by_dash_spec.rb
100
+ - spec/issues/605_root_route_documentation_spec.rb
101
+ - spec/issues/650_params_array_spec.rb
102
+ - spec/issues/677_consumes_produces_add_swagger_documentation_options_spec.rb
103
+ - spec/issues/680_keep_204_error_schemas_spec.rb
104
+ - spec/issues/721_set_default_parameter_location_based_on_consumes_spec.rb
105
+ - spec/issues/751_deeply_nested_objects_spec.rb
106
+ - spec/issues/776_multiple_presents_spec.rb
107
+ - spec/issues/784_extensions_on_params_spec.rb
108
+ - spec/issues/809_utf8_routes_spec.rb
109
+ - spec/issues/832_array_hash_float_decimal_spec.rb
110
+ - spec/issues/847_route_param_options_spec.rb
111
+ - spec/issues/873_wildcard_segments_path_parameters_spec.rb
112
+ - spec/issues/878_optional_path_segments_spec.rb
113
+ - spec/issues/881_handle_file_params_spec.rb
114
+ - spec/issues/883_query_array_parameter_spec.rb
115
+ - spec/issues/884_dont_document_non_schema_examples_spec.rb
116
+ - spec/issues/887_prevent_duplicate_operation_ids_spec.rb
117
+ - spec/lib/data_type_spec.rb
118
+ - spec/lib/endpoint/params_parser_spec.rb
119
+ - spec/lib/endpoint_spec.rb
120
+ - spec/lib/extensions_spec.rb
121
+ - spec/lib/format_data_spec.rb
122
+ - spec/lib/model_parsers_spec.rb
123
+ - spec/lib/move_params_spec.rb
124
+ - spec/lib/oapi_tasks_spec.rb
125
+ - spec/lib/operation_id_spec.rb
126
+ - spec/lib/optional_object_spec.rb
127
+ - spec/lib/parse_params_spec.rb
128
+ - spec/lib/path_string_spec.rb
129
+ - spec/lib/produces_consumes_spec.rb
130
+ - spec/lib/tag_name_description_spec.rb
131
+ - spec/lib/version_spec.rb
132
+ - spec/spec_helper.rb
133
+ - spec/support/empty_model_parser.rb
134
+ - spec/support/grape_version.rb
135
+ - spec/support/mock_parser.rb
136
+ - spec/support/model_parsers/entity_parser.rb
137
+ - spec/support/model_parsers/mock_parser.rb
138
+ - spec/support/model_parsers/representable_parser.rb
139
+ - spec/support/namespace_tags.rb
140
+ - spec/support/the_paths_definitions.rb
141
+ - spec/swagger_v2/api_documentation_spec.rb
142
+ - spec/swagger_v2/api_swagger_v2_additional_properties_spec.rb
143
+ - spec/swagger_v2/api_swagger_v2_body_definitions_spec.rb
144
+ - spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb
145
+ - spec/swagger_v2/api_swagger_v2_detail_spec.rb
146
+ - spec/swagger_v2/api_swagger_v2_extensions_spec.rb
147
+ - spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb
148
+ - spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb
149
+ - spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb
150
+ - spec/swagger_v2/api_swagger_v2_headers_spec.rb
151
+ - spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb
152
+ - spec/swagger_v2/api_swagger_v2_hide_param_spec.rb
153
+ - spec/swagger_v2/api_swagger_v2_ignore_defaults_spec.rb
154
+ - spec/swagger_v2/api_swagger_v2_mounted_spec.rb
155
+ - spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb
156
+ - spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb
157
+ - spec/swagger_v2/api_swagger_v2_param_type_spec.rb
158
+ - spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb
159
+ - spec/swagger_v2/api_swagger_v2_response_spec.rb
160
+ - spec/swagger_v2/api_swagger_v2_response_with_examples_spec.rb
161
+ - spec/swagger_v2/api_swagger_v2_response_with_headers_spec.rb
162
+ - spec/swagger_v2/api_swagger_v2_response_with_models_spec.rb
163
+ - spec/swagger_v2/api_swagger_v2_response_with_root_spec.rb
164
+ - spec/swagger_v2/api_swagger_v2_spec.rb
165
+ - spec/swagger_v2/api_swagger_v2_status_codes_spec.rb
166
+ - spec/swagger_v2/api_swagger_v2_type-format_spec.rb
167
+ - spec/swagger_v2/boolean_params_spec.rb
168
+ - spec/swagger_v2/default_api_spec.rb
169
+ - spec/swagger_v2/deprecated_field_spec.rb
170
+ - spec/swagger_v2/description_not_initialized_spec.rb
171
+ - spec/swagger_v2/endpoint_versioned_path_spec.rb
172
+ - spec/swagger_v2/errors_spec.rb
173
+ - spec/swagger_v2/float_api_spec.rb
174
+ - spec/swagger_v2/form_params_spec.rb
175
+ - spec/swagger_v2/grape-swagger_spec.rb
176
+ - spec/swagger_v2/guarded_endpoint_spec.rb
177
+ - spec/swagger_v2/hide_api_spec.rb
178
+ - spec/swagger_v2/host_spec.rb
179
+ - spec/swagger_v2/inheritance_and_discriminator_spec.rb
180
+ - spec/swagger_v2/mount_override_api_spec.rb
181
+ - spec/swagger_v2/mounted_target_class_spec.rb
182
+ - spec/swagger_v2/namespace_tags_prefix_spec.rb
183
+ - spec/swagger_v2/namespace_tags_spec.rb
184
+ - spec/swagger_v2/namespaced_api_spec.rb
185
+ - spec/swagger_v2/nicknamed_api_spec.rb
186
+ - spec/swagger_v2/operation_id_api_spec.rb
187
+ - spec/swagger_v2/param_multi_type_spec.rb
188
+ - spec/swagger_v2/param_type_spec.rb
189
+ - spec/swagger_v2/param_values_spec.rb
190
+ - spec/swagger_v2/params_array_collection_format_spec.rb
191
+ - spec/swagger_v2/params_array_spec.rb
192
+ - spec/swagger_v2/params_example_spec.rb
193
+ - spec/swagger_v2/params_hash_spec.rb
194
+ - spec/swagger_v2/params_nested_spec.rb
195
+ - spec/swagger_v2/parent_less_namespace_spec.rb
196
+ - spec/swagger_v2/reference_entity_spec.rb
197
+ - spec/swagger_v2/security_requirement_spec.rb
198
+ - spec/swagger_v2/simple_mounted_api_spec.rb
199
+ - spec/version_spec.rb
200
+ homepage: https://gitlab.com/gitlab-org/ruby/gems/grape-swagger
201
+ licenses:
202
+ - MIT
203
+ metadata:
204
+ rubygems_mfa_required: 'true'
205
+ post_install_message:
206
+ rdoc_options: []
207
+ require_paths:
208
+ - lib
209
+ required_ruby_version: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - ">="
212
+ - !ruby/object:Gem::Version
213
+ version: '2.7'
214
+ required_rubygems_version: !ruby/object:Gem::Requirement
215
+ requirements:
216
+ - - ">="
217
+ - !ruby/object:Gem::Version
218
+ version: '0'
219
+ requirements: []
220
+ rubygems_version: 3.1.6
221
+ signing_key:
222
+ specification_version: 4
223
+ summary: Add auto generated documentation to your Grape API that can be displayed
224
+ with Swagger.
225
+ test_files: []