apipie-rails 0.9.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop.yml +2 -2
- data/.rubocop.yml +23 -14
- data/.rubocop_todo.yml +103 -487
- data/CHANGELOG.md +20 -3
- data/README.rst +12 -12
- data/app/controllers/apipie/apipies_controller.rb +6 -6
- data/app/helpers/apipie_helper.rb +1 -1
- data/lib/apipie/apipie_module.rb +5 -5
- data/lib/apipie/application.rb +81 -55
- data/lib/apipie/configuration.rb +19 -26
- data/lib/apipie/dsl_definition.rb +8 -9
- data/lib/apipie/error_description.rb +1 -1
- data/lib/apipie/errors.rb +2 -16
- data/lib/apipie/extractor/collector.rb +3 -3
- data/lib/apipie/extractor/recorder.rb +1 -1
- data/lib/apipie/extractor.rb +2 -2
- data/lib/apipie/generator/config.rb +12 -0
- data/lib/apipie/generator/swagger/computed_interface_id.rb +23 -0
- data/lib/apipie/generator/swagger/config.rb +78 -0
- data/lib/apipie/generator/swagger/context.rb +12 -1
- data/lib/apipie/generator/swagger/method_description/api_decorator.rb +20 -0
- data/lib/apipie/generator/swagger/method_description/api_schema_service.rb +86 -0
- data/lib/apipie/generator/swagger/method_description/decorator.rb +22 -0
- data/lib/apipie/generator/swagger/method_description/parameters_service.rb +139 -0
- data/lib/apipie/generator/swagger/method_description/response_schema_service.rb +46 -0
- data/lib/apipie/generator/swagger/method_description/response_service.rb +58 -0
- data/lib/apipie/generator/swagger/method_description.rb +2 -0
- data/lib/apipie/generator/swagger/operation_id.rb +2 -2
- data/lib/apipie/generator/swagger/param_description/builder.rb +4 -4
- data/lib/apipie/generator/swagger/param_description/composite.rb +9 -1
- data/lib/apipie/generator/swagger/param_description/in.rb +1 -1
- data/lib/apipie/generator/swagger/param_description/path_params_composite.rb +61 -0
- data/lib/apipie/generator/swagger/param_description/referenced_composite.rb +36 -0
- data/lib/apipie/generator/swagger/param_description/type.rb +9 -2
- data/lib/apipie/generator/swagger/path_decorator.rb +36 -0
- data/lib/apipie/generator/swagger/referenced_definitions.rb +17 -0
- data/lib/apipie/generator/swagger/resource_description_collection.rb +30 -0
- data/lib/apipie/generator/swagger/resource_description_composite.rb +56 -0
- data/lib/apipie/generator/swagger/schema.rb +63 -0
- data/lib/apipie/generator/swagger/type_extractor.rb +0 -19
- data/lib/apipie/generator/swagger/warning.rb +3 -6
- data/lib/apipie/generator/swagger/warning_writer.rb +7 -1
- data/lib/apipie/helpers.rb +3 -3
- data/lib/apipie/method_description.rb +5 -3
- data/lib/apipie/param_description.rb +4 -2
- data/lib/apipie/resource_description.rb +11 -8
- data/lib/apipie/response_description.rb +1 -1
- data/lib/apipie/response_description_adapter.rb +3 -3
- data/lib/apipie/routing.rb +1 -1
- data/lib/apipie/rspec/response_validation_helper.rb +1 -1
- data/lib/apipie/swagger_generator.rb +27 -551
- data/lib/apipie/validator.rb +9 -5
- data/lib/apipie/version.rb +1 -1
- data/lib/apipie-rails.rb +17 -0
- data/lib/tasks/apipie.rake +25 -20
- data/spec/controllers/api/v2/nested/resources_controller_spec.rb +2 -2
- data/spec/controllers/pets_controller_spec.rb +10 -16
- data/spec/controllers/users_controller_spec.rb +2 -2
- data/spec/dummy/app/controllers/pets_controller.rb +4 -4
- data/spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb +2 -2
- data/spec/dummy/app/controllers/twitter_example_controller.rb +2 -2
- data/spec/dummy/app/controllers/users_controller.rb +5 -5
- data/spec/dummy/config.ru +1 -1
- data/spec/lib/apipie/apipies_controller_spec.rb +4 -0
- data/spec/lib/apipie/application_spec.rb +25 -15
- data/spec/lib/apipie/configuration_spec.rb +15 -0
- data/spec/lib/apipie/generator/swagger/config_spec.rb +19 -0
- data/spec/lib/apipie/generator/swagger/context_spec.rb +23 -2
- data/spec/lib/apipie/generator/swagger/method_description/api_schema_service_spec.rb +106 -0
- data/spec/lib/apipie/generator/swagger/method_description/response_schema_service_spec.rb +105 -0
- data/spec/lib/apipie/generator/swagger/param_description/builder_spec.rb +1 -1
- data/spec/lib/apipie/generator/swagger/param_description/composite_spec.rb +2 -2
- data/spec/lib/apipie/generator/swagger/param_description/type_spec.rb +7 -7
- data/spec/lib/apipie/generator/swagger/path_decorator_spec.rb +57 -0
- data/spec/lib/apipie/generator/swagger/referenced_definitions_spec.rb +35 -0
- data/spec/lib/apipie/generator/swagger/resource_description_composite_spec.rb +37 -0
- data/spec/lib/apipie/generator/swagger/resource_descriptions_collection_spec.rb +57 -0
- data/spec/lib/apipie/generator/swagger/schema_spec.rb +89 -0
- data/spec/lib/apipie/generator/swagger/type_extractor_spec.rb +0 -43
- data/spec/lib/apipie/generator/swagger/warning_spec.rb +1 -1
- data/spec/lib/apipie/generator/swagger/warning_writer_spec.rb +19 -7
- data/spec/lib/apipie/method_description_spec.rb +101 -66
- data/spec/lib/apipie/no_documented_method_spec.rb +17 -0
- data/spec/lib/apipie/param_description_spec.rb +209 -49
- data/spec/lib/apipie/param_group_spec.rb +1 -0
- data/spec/lib/apipie/resource_description_spec.rb +71 -28
- data/spec/lib/apipie/response_does_not_match_swagger_schema_spec.rb +35 -0
- data/spec/lib/apipie/swagger_generator_spec.rb +94 -0
- data/spec/lib/apipie/validator_spec.rb +47 -11
- data/spec/lib/rake_spec.rb +1 -1
- data/spec/lib/swagger/rake_swagger_spec.rb +6 -6
- data/spec/lib/swagger/swagger_dsl_spec.rb +17 -11
- data/spec/lib/validators/array_validator_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 822d52cddc54c458cc7449d9f881a68ee6766811d740cbc0a6d717f4760b8896
|
4
|
+
data.tar.gz: 37a6bd59c3e1fac91dbcb8ef34078caa28c19b9e27bcad872d70796096dfc67f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
@@ -55,6 +57,9 @@ Naming/PredicateName:
|
|
55
57
|
AllowedMethods:
|
56
58
|
- have_field?
|
57
59
|
|
60
|
+
Style/IfUnlessModifier:
|
61
|
+
Enabled: false
|
62
|
+
|
58
63
|
Style/NumericPredicate:
|
59
64
|
Enabled: false
|
60
65
|
|
@@ -62,6 +67,10 @@ Style/HashSyntax:
|
|
62
67
|
EnforcedStyle: no_mixed_keys
|
63
68
|
EnforcedShorthandSyntax: never # consistent
|
64
69
|
|
70
|
+
Metrics/ParameterLists:
|
71
|
+
Exclude:
|
72
|
+
- 'lib/apipie/generator/swagger/context.rb'
|
73
|
+
|
65
74
|
Style/Documentation:
|
66
75
|
Exclude:
|
67
76
|
- 'app/controllers/apipie/apipies_controller.rb'
|
@@ -78,20 +87,7 @@ Style/Documentation:
|
|
78
87
|
- 'lib/apipie/extractor/recorder.rb'
|
79
88
|
- 'lib/apipie/extractor/writer.rb'
|
80
89
|
- 'lib/apipie/generator/generator.rb'
|
81
|
-
- 'lib/apipie/generator/swagger
|
82
|
-
- 'lib/apipie/generator/swagger/operation_id.rb'
|
83
|
-
- 'lib/apipie/generator/swagger/param_description.rb'
|
84
|
-
- 'lib/apipie/generator/swagger/param_description/builder.rb'
|
85
|
-
- 'lib/apipie/generator/swagger/param_description/composite.rb'
|
86
|
-
- 'lib/apipie/generator/swagger/param_description/description.rb'
|
87
|
-
- 'lib/apipie/generator/swagger/param_description/in.rb'
|
88
|
-
- 'lib/apipie/generator/swagger/param_description/name.rb'
|
89
|
-
- 'lib/apipie/generator/swagger/param_description/type.rb'
|
90
|
-
- 'lib/apipie/generator/swagger/swagger.rb'
|
91
|
-
- 'lib/apipie/generator/swagger/type.rb'
|
92
|
-
- 'lib/apipie/generator/swagger/type_extractor.rb'
|
93
|
-
- 'lib/apipie/generator/swagger/warning.rb'
|
94
|
-
- 'lib/apipie/generator/swagger/warning_writer.rb'
|
90
|
+
- 'lib/apipie/generator/swagger/**/*'
|
95
91
|
- 'lib/apipie/helpers.rb'
|
96
92
|
- 'lib/apipie/markup.rb'
|
97
93
|
- 'lib/apipie/method_description.rb'
|
@@ -103,6 +99,7 @@ Style/Documentation:
|
|
103
99
|
- 'lib/apipie/routes_formatter.rb'
|
104
100
|
- 'lib/apipie/routing.rb'
|
105
101
|
- 'lib/apipie/rspec/response_validation_helper.rb'
|
102
|
+
- 'lib/apipie/swagger_generator.rb'
|
106
103
|
- 'lib/apipie/see_description.rb'
|
107
104
|
- 'lib/apipie/static_dispatcher.rb'
|
108
105
|
- 'lib/apipie/tag_list_description.rb'
|
@@ -113,6 +110,18 @@ Style/Documentation:
|
|
113
110
|
- spec/lib/validators/array_validator_spec.rb
|
114
111
|
- spec/dummy/**/*.rb
|
115
112
|
|
113
|
+
Style/FrozenStringLiteralComment:
|
114
|
+
Enabled: false
|
115
|
+
|
116
|
+
Style/InverseMethods:
|
117
|
+
Enabled: false
|
118
|
+
|
116
119
|
Naming/BlockForwarding:
|
117
120
|
EnforcedStyle: explicit
|
118
121
|
BlockForwardingName: block
|
122
|
+
|
123
|
+
Lint/MissingSuper:
|
124
|
+
Exclude:
|
125
|
+
- 'lib/apipie/errors.rb'
|
126
|
+
- 'lib/apipie/response_description_adapter.rb'
|
127
|
+
- 'lib/apipie/validator.rb'
|