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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b80c8d9148eb30ad409dcbd396a7b48a55f168c9f64f3dbc699bf11ba2f5a71
4
- data.tar.gz: 7530489978c584ec75e533c913acf179a76ed0b6ee9c8fa5a0947f8c163cb07d
3
+ metadata.gz: 822d52cddc54c458cc7449d9f881a68ee6766811d740cbc0a6d717f4760b8896
4
+ data.tar.gz: 37a6bd59c3e1fac91dbcb8ef34078caa28c19b9e27bcad872d70796096dfc67f
5
5
  SHA512:
6
- metadata.gz: 2c1fd67f999a263c2d1655eaf5e7424ef7c98b6bb269b9f54ace1f201cad01447f769dc2ec83ba3d8ec60057f28ee2661e849061a22af49514fd03f1cbc7d75f
7
- data.tar.gz: 7fbdd5e6bd529f66327346986ec8ba093518b1e94281da7a4f72c05cc00d1b64090736f70681b1142a9489fbb0f41a1956d9ef72b3f7b65694d8c59fa0831cc0
6
+ metadata.gz: a16332ce330bd90cc3a12bc57b5904bc7e66cd0f21dd66fd497903a139fb826c7e4e796fbdf440bb17c48427755d3cd66e548660e3e8a4a549dd8b97f5205db4
7
+ data.tar.gz: 1ac7735265214806b2beb8d7414c18915a8de995bf55339c93124f5247833284a30d566517ce71266718da3a237769d48c1a02bc1f6d5b11a893908bcc33f4d8
data/.rubocop.yml CHANGED
@@ -38,6 +38,7 @@ Metrics/ClassLength:
38
38
  - lib/apipie/extractor/writer.rb
39
39
  - lib/apipie/application.rb
40
40
  - lib/apipie/param_description.rb
41
+ - lib/apipie/method_description.rb
41
42
  - lib/apipie/swagger_generator.rb
42
43
  - spec/dummy/app/controllers/pets_controller.rb
43
44
  - spec/dummy/app/controllers/twitter_example_controller.rb
@@ -48,6 +49,7 @@ Metrics/BlockLength:
48
49
  Exclude:
49
50
  - app/controllers/apipie/apipies_controller.rb
50
51
  - lib/apipie/generator/swagger/param_description/composite.rb
52
+ - lib/apipie/generator/swagger/param_description/path_params_composite.rb
51
53
  - lib/tasks/apipie.rake
52
54
  - lib/apipie/swagger_generator.rb
53
55
 
@@ -65,6 +67,10 @@ Style/HashSyntax:
65
67
  EnforcedStyle: no_mixed_keys
66
68
  EnforcedShorthandSyntax: never # consistent
67
69
 
70
+ Metrics/ParameterLists:
71
+ Exclude:
72
+ - 'lib/apipie/generator/swagger/context.rb'
73
+
68
74
  Style/Documentation:
69
75
  Exclude:
70
76
  - 'app/controllers/apipie/apipies_controller.rb'
@@ -81,20 +87,7 @@ Style/Documentation:
81
87
  - 'lib/apipie/extractor/recorder.rb'
82
88
  - 'lib/apipie/extractor/writer.rb'
83
89
  - 'lib/apipie/generator/generator.rb'
84
- - 'lib/apipie/generator/swagger/context.rb'
85
- - 'lib/apipie/generator/swagger/operation_id.rb'
86
- - 'lib/apipie/generator/swagger/param_description.rb'
87
- - 'lib/apipie/generator/swagger/param_description/builder.rb'
88
- - 'lib/apipie/generator/swagger/param_description/composite.rb'
89
- - 'lib/apipie/generator/swagger/param_description/description.rb'
90
- - 'lib/apipie/generator/swagger/param_description/in.rb'
91
- - 'lib/apipie/generator/swagger/param_description/name.rb'
92
- - 'lib/apipie/generator/swagger/param_description/type.rb'
93
- - 'lib/apipie/generator/swagger/swagger.rb'
94
- - 'lib/apipie/generator/swagger/type.rb'
95
- - 'lib/apipie/generator/swagger/type_extractor.rb'
96
- - 'lib/apipie/generator/swagger/warning.rb'
97
- - 'lib/apipie/generator/swagger/warning_writer.rb'
90
+ - 'lib/apipie/generator/swagger/**/*'
98
91
  - 'lib/apipie/helpers.rb'
99
92
  - 'lib/apipie/markup.rb'
100
93
  - 'lib/apipie/method_description.rb'
@@ -106,6 +99,7 @@ Style/Documentation:
106
99
  - 'lib/apipie/routes_formatter.rb'
107
100
  - 'lib/apipie/routing.rb'
108
101
  - 'lib/apipie/rspec/response_validation_helper.rb'
102
+ - 'lib/apipie/swagger_generator.rb'
109
103
  - 'lib/apipie/see_description.rb'
110
104
  - 'lib/apipie/static_dispatcher.rb'
111
105
  - 'lib/apipie/tag_list_description.rb'