apipie-rails 0.9.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +8 -14
  3. data/.rubocop_todo.yml +102 -213
  4. data/CHANGELOG.md +17 -6
  5. data/README.rst +12 -12
  6. data/app/controllers/apipie/apipies_controller.rb +4 -4
  7. data/lib/apipie/apipie_module.rb +4 -4
  8. data/lib/apipie/application.rb +70 -54
  9. data/lib/apipie/configuration.rb +19 -26
  10. data/lib/apipie/dsl_definition.rb +4 -5
  11. data/lib/apipie/extractor/collector.rb +2 -2
  12. data/lib/apipie/extractor.rb +1 -1
  13. data/lib/apipie/generator/config.rb +12 -0
  14. data/lib/apipie/generator/swagger/computed_interface_id.rb +23 -0
  15. data/lib/apipie/generator/swagger/config.rb +78 -0
  16. data/lib/apipie/generator/swagger/context.rb +12 -1
  17. data/lib/apipie/generator/swagger/method_description/api_decorator.rb +20 -0
  18. data/lib/apipie/generator/swagger/method_description/api_schema_service.rb +86 -0
  19. data/lib/apipie/generator/swagger/method_description/decorator.rb +22 -0
  20. data/lib/apipie/generator/swagger/method_description/parameters_service.rb +139 -0
  21. data/lib/apipie/generator/swagger/method_description/response_schema_service.rb +46 -0
  22. data/lib/apipie/generator/swagger/method_description/response_service.rb +58 -0
  23. data/lib/apipie/generator/swagger/method_description.rb +2 -0
  24. data/lib/apipie/generator/swagger/operation_id.rb +1 -1
  25. data/lib/apipie/generator/swagger/param_description/builder.rb +4 -4
  26. data/lib/apipie/generator/swagger/param_description/composite.rb +9 -1
  27. data/lib/apipie/generator/swagger/param_description/in.rb +1 -1
  28. data/lib/apipie/generator/swagger/param_description/path_params_composite.rb +61 -0
  29. data/lib/apipie/generator/swagger/param_description/referenced_composite.rb +36 -0
  30. data/lib/apipie/generator/swagger/param_description/type.rb +9 -2
  31. data/lib/apipie/generator/swagger/path_decorator.rb +36 -0
  32. data/lib/apipie/generator/swagger/referenced_definitions.rb +17 -0
  33. data/lib/apipie/generator/swagger/resource_description_collection.rb +30 -0
  34. data/lib/apipie/generator/swagger/resource_description_composite.rb +56 -0
  35. data/lib/apipie/generator/swagger/schema.rb +63 -0
  36. data/lib/apipie/generator/swagger/type_extractor.rb +0 -19
  37. data/lib/apipie/generator/swagger/warning.rb +3 -6
  38. data/lib/apipie/generator/swagger/warning_writer.rb +7 -1
  39. data/lib/apipie/method_description.rb +4 -2
  40. data/lib/apipie/param_description.rb +4 -2
  41. data/lib/apipie/resource_description.rb +1 -1
  42. data/lib/apipie/swagger_generator.rb +27 -551
  43. data/lib/apipie/validator.rb +7 -3
  44. data/lib/apipie/version.rb +1 -1
  45. data/lib/apipie-rails.rb +17 -0
  46. data/lib/tasks/apipie.rake +15 -10
  47. data/spec/controllers/api/v2/nested/resources_controller_spec.rb +2 -2
  48. data/spec/controllers/pets_controller_spec.rb +10 -16
  49. data/spec/controllers/users_controller_spec.rb +2 -2
  50. data/spec/dummy/app/controllers/pets_controller.rb +4 -4
  51. data/spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb +2 -2
  52. data/spec/dummy/app/controllers/twitter_example_controller.rb +2 -2
  53. data/spec/dummy/app/controllers/users_controller.rb +5 -5
  54. data/spec/lib/apipie/application_spec.rb +16 -7
  55. data/spec/lib/apipie/configuration_spec.rb +15 -0
  56. data/spec/lib/apipie/generator/swagger/config_spec.rb +19 -0
  57. data/spec/lib/apipie/generator/swagger/context_spec.rb +22 -2
  58. data/spec/lib/apipie/generator/swagger/method_description/api_schema_service_spec.rb +106 -0
  59. data/spec/lib/apipie/generator/swagger/method_description/response_schema_service_spec.rb +105 -0
  60. data/spec/lib/apipie/generator/swagger/param_description/builder_spec.rb +1 -1
  61. data/spec/lib/apipie/generator/swagger/param_description/composite_spec.rb +2 -2
  62. data/spec/lib/apipie/generator/swagger/param_description/type_spec.rb +7 -7
  63. data/spec/lib/apipie/generator/swagger/path_decorator_spec.rb +57 -0
  64. data/spec/lib/apipie/generator/swagger/referenced_definitions_spec.rb +35 -0
  65. data/spec/lib/apipie/generator/swagger/resource_description_composite_spec.rb +37 -0
  66. data/spec/lib/apipie/generator/swagger/resource_descriptions_collection_spec.rb +57 -0
  67. data/spec/lib/apipie/generator/swagger/schema_spec.rb +89 -0
  68. data/spec/lib/apipie/generator/swagger/type_extractor_spec.rb +0 -43
  69. data/spec/lib/apipie/generator/swagger/warning_spec.rb +1 -1
  70. data/spec/lib/apipie/generator/swagger/warning_writer_spec.rb +19 -7
  71. data/spec/lib/apipie/method_description_spec.rb +101 -66
  72. data/spec/lib/apipie/param_description_spec.rb +209 -49
  73. data/spec/lib/apipie/param_group_spec.rb +1 -0
  74. data/spec/lib/apipie/resource_description_spec.rb +1 -1
  75. data/spec/lib/apipie/swagger_generator_spec.rb +94 -0
  76. data/spec/lib/apipie/validator_spec.rb +47 -11
  77. data/spec/lib/swagger/rake_swagger_spec.rb +4 -4
  78. data/spec/lib/swagger/swagger_dsl_spec.rb +7 -7
  79. data/spec/lib/validators/array_validator_spec.rb +1 -1
  80. metadata +28 -2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apipie-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pokorny
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-04-10 00:00:00.000000000 Z
12
+ date: 2023-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -278,8 +278,18 @@ files:
278
278
  - lib/apipie/extractor/collector.rb
279
279
  - lib/apipie/extractor/recorder.rb
280
280
  - lib/apipie/extractor/writer.rb
281
+ - lib/apipie/generator/config.rb
281
282
  - lib/apipie/generator/generator.rb
283
+ - lib/apipie/generator/swagger/computed_interface_id.rb
284
+ - lib/apipie/generator/swagger/config.rb
282
285
  - lib/apipie/generator/swagger/context.rb
286
+ - lib/apipie/generator/swagger/method_description.rb
287
+ - lib/apipie/generator/swagger/method_description/api_decorator.rb
288
+ - lib/apipie/generator/swagger/method_description/api_schema_service.rb
289
+ - lib/apipie/generator/swagger/method_description/decorator.rb
290
+ - lib/apipie/generator/swagger/method_description/parameters_service.rb
291
+ - lib/apipie/generator/swagger/method_description/response_schema_service.rb
292
+ - lib/apipie/generator/swagger/method_description/response_service.rb
283
293
  - lib/apipie/generator/swagger/operation_id.rb
284
294
  - lib/apipie/generator/swagger/param_description.rb
285
295
  - lib/apipie/generator/swagger/param_description/builder.rb
@@ -287,7 +297,14 @@ files:
287
297
  - lib/apipie/generator/swagger/param_description/description.rb
288
298
  - lib/apipie/generator/swagger/param_description/in.rb
289
299
  - lib/apipie/generator/swagger/param_description/name.rb
300
+ - lib/apipie/generator/swagger/param_description/path_params_composite.rb
301
+ - lib/apipie/generator/swagger/param_description/referenced_composite.rb
290
302
  - lib/apipie/generator/swagger/param_description/type.rb
303
+ - lib/apipie/generator/swagger/path_decorator.rb
304
+ - lib/apipie/generator/swagger/referenced_definitions.rb
305
+ - lib/apipie/generator/swagger/resource_description_collection.rb
306
+ - lib/apipie/generator/swagger/resource_description_composite.rb
307
+ - lib/apipie/generator/swagger/schema.rb
291
308
  - lib/apipie/generator/swagger/swagger.rb
292
309
  - lib/apipie/generator/swagger/type.rb
293
310
  - lib/apipie/generator/swagger/type_extractor.rb
@@ -396,7 +413,10 @@ files:
396
413
  - spec/lib/apipie/extractor/writer_spec.rb
397
414
  - spec/lib/apipie/extractor_spec.rb
398
415
  - spec/lib/apipie/file_handler_spec.rb
416
+ - spec/lib/apipie/generator/swagger/config_spec.rb
399
417
  - spec/lib/apipie/generator/swagger/context_spec.rb
418
+ - spec/lib/apipie/generator/swagger/method_description/api_schema_service_spec.rb
419
+ - spec/lib/apipie/generator/swagger/method_description/response_schema_service_spec.rb
400
420
  - spec/lib/apipie/generator/swagger/operation_id_spec.rb
401
421
  - spec/lib/apipie/generator/swagger/param_description/builder_spec.rb
402
422
  - spec/lib/apipie/generator/swagger/param_description/composite_spec.rb
@@ -405,6 +425,11 @@ files:
405
425
  - spec/lib/apipie/generator/swagger/param_description/name_spec.rb
406
426
  - spec/lib/apipie/generator/swagger/param_description/type_spec.rb
407
427
  - spec/lib/apipie/generator/swagger/param_description_spec.rb
428
+ - spec/lib/apipie/generator/swagger/path_decorator_spec.rb
429
+ - spec/lib/apipie/generator/swagger/referenced_definitions_spec.rb
430
+ - spec/lib/apipie/generator/swagger/resource_description_composite_spec.rb
431
+ - spec/lib/apipie/generator/swagger/resource_descriptions_collection_spec.rb
432
+ - spec/lib/apipie/generator/swagger/schema_spec.rb
408
433
  - spec/lib/apipie/generator/swagger/type_extractor_spec.rb
409
434
  - spec/lib/apipie/generator/swagger/warning_spec.rb
410
435
  - spec/lib/apipie/generator/swagger/warning_writer_spec.rb
@@ -416,6 +441,7 @@ files:
416
441
  - spec/lib/apipie/param_group_spec.rb
417
442
  - spec/lib/apipie/resource_description_spec.rb
418
443
  - spec/lib/apipie/response_does_not_match_swagger_schema_spec.rb
444
+ - spec/lib/apipie/swagger_generator_spec.rb
419
445
  - spec/lib/apipie/validator_spec.rb
420
446
  - spec/lib/rake_spec.rb
421
447
  - spec/lib/swagger/openapi_2_0_schema.json