apipie-rails 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +46 -135
- data/CHANGELOG.md +16 -0
- data/apipie-rails.gemspec +1 -0
- data/lib/apipie/application.rb +6 -6
- data/lib/apipie/error_description.rb +7 -5
- data/lib/apipie/extractor/recorder.rb +3 -3
- data/lib/apipie/extractor/writer.rb +6 -6
- data/lib/apipie/generator/swagger/method_description/api_schema_service.rb +2 -2
- data/lib/apipie/generator/swagger/method_description/parameters_service.rb +7 -7
- data/lib/apipie/generator/swagger/param_description/builder.rb +3 -3
- data/lib/apipie/generator/swagger/param_description/in.rb +1 -1
- data/lib/apipie/generator/swagger/param_description/path_params_composite.rb +10 -10
- data/lib/apipie/generator/swagger/param_description/type.rb +5 -1
- data/lib/apipie/generator/swagger/resource_description_composite.rb +5 -5
- data/lib/apipie/generator/swagger/type_extractor.rb +1 -1
- data/lib/apipie/generator/swagger/warning.rb +2 -2
- data/lib/apipie/helpers.rb +1 -1
- data/lib/apipie/response_description.rb +10 -5
- data/lib/apipie/routes_formatter.rb +1 -1
- data/lib/apipie/static_dispatcher.rb +2 -2
- data/lib/apipie/version.rb +1 -1
- data/lib/tasks/apipie.rake +4 -4
- data/spec/controllers/api/v1/architectures_controller_spec.rb +3 -3
- data/spec/controllers/api/v2/nested/resources_controller_spec.rb +1 -1
- data/spec/controllers/concerns_controller_spec.rb +2 -2
- data/spec/controllers/extended_controller_spec.rb +2 -2
- data/spec/controllers/included_param_group_controller_spec.rb +1 -1
- data/spec/controllers/pets_controller_spec.rb +1 -1
- data/spec/controllers/users_controller_spec.rb +64 -63
- data/spec/dummy/app/controllers/extending_concern.rb +7 -7
- data/spec/dummy/app/controllers/pets_controller.rb +4 -4
- data/spec/dummy/app/controllers/pets_using_auto_views_controller.rb +2 -2
- data/spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb +16 -16
- data/spec/dummy/app/controllers/sample_controller.rb +31 -31
- data/spec/lib/apipie/application_spec.rb +2 -2
- data/spec/lib/apipie/extractor/writer_spec.rb +8 -8
- data/spec/lib/apipie/generator/swagger/param_description/builder_spec.rb +30 -0
- data/spec/lib/apipie/generator/swagger/param_description/type_spec.rb +29 -2
- data/spec/lib/apipie/method_description_spec.rb +2 -2
- data/spec/lib/apipie/param_description_spec.rb +47 -47
- data/spec/lib/apipie/param_group_spec.rb +4 -4
- data/spec/lib/apipie/resource_description_spec.rb +2 -2
- data/spec/lib/apipie/validator_spec.rb +12 -12
- data/spec/lib/swagger/swagger_dsl_spec.rb +40 -40
- data/spec/spec_helper.rb +5 -2
- data/spec/test_engine/memes_controller_spec.rb +1 -1
- metadata +138 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c72cb8c9744d64b6d940b81e8e692f7794ebce0e4c8438cced6e5e844e7690cb
|
4
|
+
data.tar.gz: 68ffc84b4faf041018bacd00519b071702726035466b6fc44c380bd66de98bcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1de4f529cc90ccf084c4f567576a0db46e51f1aebb470f01818f59479e04847371709ef5e6e05377d9acdd20d39950f27a75b517650f65c29a7d7d460e651884
|
7
|
+
data.tar.gz: 8841db6ef76b1696cbee3f0cafdabbdf3eaca5e94c185604490f7771bbd38bdf6a55c4f720e998558996cca83f70e512dd7e8f9f80c74721d6c11e3dd554c931
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-rails
|
3
3
|
- rubocop-rspec
|
4
|
+
- rubocop-rspec_rails
|
4
5
|
- rubocop-performance
|
5
6
|
|
6
7
|
inherit_from: .rubocop_todo.yml
|
@@ -12,6 +13,9 @@ AllCops:
|
|
12
13
|
NewCops: enable
|
13
14
|
TargetRubyVersion: 2.6
|
14
15
|
|
16
|
+
Layout/MultilineMethodCallIndentation:
|
17
|
+
EnforcedStyle: indented
|
18
|
+
|
15
19
|
Layout/LineLength:
|
16
20
|
Max: 140
|
17
21
|
Exclude:
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
|
-
# `rubocop --auto-gen-config --exclude-limit
|
3
|
-
# on
|
2
|
+
# `rubocop --auto-gen-config --exclude-limit 180`
|
3
|
+
# on 2024-07-10 23:53:15 UTC using RuboCop version 1.65.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -14,7 +14,7 @@ Gemspec/DeprecatedAttributeAssignment:
|
|
14
14
|
Exclude:
|
15
15
|
- 'apipie-rails.gemspec'
|
16
16
|
|
17
|
-
# Offense count:
|
17
|
+
# Offense count: 12
|
18
18
|
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
|
19
19
|
# SupportedStyles: Gemfile, gems.rb, gemspec
|
20
20
|
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
|
@@ -46,6 +46,13 @@ Gemspec/RequiredRubyVersion:
|
|
46
46
|
Exclude:
|
47
47
|
- 'spec/dummy/components/test_engine/test_engine.gemspec'
|
48
48
|
|
49
|
+
# Offense count: 1
|
50
|
+
# Configuration parameters: Severity, Include.
|
51
|
+
# Include: **/*.gemspec
|
52
|
+
Gemspec/RubyVersionGlobalsUsage:
|
53
|
+
Exclude:
|
54
|
+
- 'apipie-rails.gemspec'
|
55
|
+
|
49
56
|
# Offense count: 24
|
50
57
|
# This cop supports safe autocorrection (--autocorrect).
|
51
58
|
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
@@ -138,7 +145,7 @@ Layout/EmptyLineAfterGuardClause:
|
|
138
145
|
- 'spec/lib/swagger/swagger_dsl_spec.rb'
|
139
146
|
- 'spec/spec_helper.rb'
|
140
147
|
|
141
|
-
# Offense count:
|
148
|
+
# Offense count: 12
|
142
149
|
# This cop supports safe autocorrection (--autocorrect).
|
143
150
|
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
|
144
151
|
Layout/EmptyLineBetweenDefs:
|
@@ -154,7 +161,7 @@ Layout/EmptyLineBetweenDefs:
|
|
154
161
|
- 'spec/dummy/app/controllers/pets_using_auto_views_controller.rb'
|
155
162
|
- 'spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb'
|
156
163
|
|
157
|
-
# Offense count:
|
164
|
+
# Offense count: 54
|
158
165
|
# This cop supports safe autocorrection (--autocorrect).
|
159
166
|
Layout/EmptyLines:
|
160
167
|
Exclude:
|
@@ -192,7 +199,7 @@ Layout/EmptyLinesAroundAttributeAccessor:
|
|
192
199
|
Exclude:
|
193
200
|
- 'lib/apipie/configuration.rb'
|
194
201
|
|
195
|
-
# Offense count:
|
202
|
+
# Offense count: 91
|
196
203
|
# This cop supports safe autocorrection (--autocorrect).
|
197
204
|
# Configuration parameters: EnforcedStyle.
|
198
205
|
# SupportedStyles: empty_lines, no_empty_lines
|
@@ -213,7 +220,6 @@ Layout/EmptyLinesAroundBlockBody:
|
|
213
220
|
- 'spec/lib/apipie/extractor/writer_spec.rb'
|
214
221
|
- 'spec/lib/apipie/file_handler_spec.rb'
|
215
222
|
- 'spec/lib/apipie/generator/swagger/param_description/composite_spec.rb'
|
216
|
-
- 'spec/lib/apipie/generator/swagger/param_description/type_spec.rb'
|
217
223
|
- 'spec/lib/apipie/param_description_spec.rb'
|
218
224
|
- 'spec/lib/apipie/param_group_spec.rb'
|
219
225
|
- 'spec/lib/apipie/validator_spec.rb'
|
@@ -224,7 +230,7 @@ Layout/EmptyLinesAroundBlockBody:
|
|
224
230
|
- 'spec/spec_helper.rb'
|
225
231
|
- 'spec/test_engine/memes_controller_spec.rb'
|
226
232
|
|
227
|
-
# Offense count:
|
233
|
+
# Offense count: 43
|
228
234
|
# This cop supports safe autocorrection (--autocorrect).
|
229
235
|
# Configuration parameters: EnforcedStyle.
|
230
236
|
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
|
@@ -238,7 +244,6 @@ Layout/EmptyLinesAroundClassBody:
|
|
238
244
|
- 'lib/apipie/markup.rb'
|
239
245
|
- 'lib/apipie/param_description.rb'
|
240
246
|
- 'lib/apipie/resource_description.rb'
|
241
|
-
- 'lib/apipie/response_description.rb'
|
242
247
|
- 'lib/apipie/response_description_adapter.rb'
|
243
248
|
- 'lib/apipie/see_description.rb'
|
244
249
|
- 'lib/apipie/tag_list_description.rb'
|
@@ -314,15 +319,6 @@ Layout/ExtraSpacing:
|
|
314
319
|
- 'spec/lib/apipie/generator/swagger/param_description/type_spec.rb'
|
315
320
|
- 'spec/lib/swagger/swagger_dsl_spec.rb'
|
316
321
|
|
317
|
-
# Offense count: 9
|
318
|
-
# This cop supports safe autocorrection (--autocorrect).
|
319
|
-
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
320
|
-
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
|
321
|
-
Layout/FirstArrayElementIndentation:
|
322
|
-
Exclude:
|
323
|
-
- 'spec/dummy/app/controllers/pets_controller.rb'
|
324
|
-
- 'spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb'
|
325
|
-
|
326
322
|
# Offense count: 38
|
327
323
|
# This cop supports safe autocorrection (--autocorrect).
|
328
324
|
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
@@ -387,13 +383,6 @@ Layout/IndentationWidth:
|
|
387
383
|
- 'lib/apipie/resource_description.rb'
|
388
384
|
- 'lib/tasks/apipie.rake'
|
389
385
|
|
390
|
-
# Offense count: 2
|
391
|
-
# This cop supports safe autocorrection (--autocorrect).
|
392
|
-
Layout/InitialIndentation:
|
393
|
-
Exclude:
|
394
|
-
- 'spec/dummy/app/controllers/extending_concern.rb'
|
395
|
-
- 'spec/dummy/app/controllers/sample_controller.rb'
|
396
|
-
|
397
386
|
# Offense count: 15
|
398
387
|
# This cop supports safe autocorrection (--autocorrect).
|
399
388
|
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
|
@@ -428,16 +417,6 @@ Layout/MultilineMethodCallBraceLayout:
|
|
428
417
|
Exclude:
|
429
418
|
- 'lib/tasks/apipie.rake'
|
430
419
|
|
431
|
-
# Offense count: 14
|
432
|
-
# This cop supports safe autocorrection (--autocorrect).
|
433
|
-
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
434
|
-
# SupportedStyles: aligned, indented, indented_relative_to_receiver
|
435
|
-
Layout/MultilineMethodCallIndentation:
|
436
|
-
Exclude:
|
437
|
-
- 'lib/apipie/generator/swagger/param_description/builder.rb'
|
438
|
-
- 'lib/apipie/generator/swagger/param_description/composite.rb'
|
439
|
-
- 'lib/apipie/generator/swagger/param_description/type.rb'
|
440
|
-
|
441
420
|
# Offense count: 4
|
442
421
|
# This cop supports safe autocorrection (--autocorrect).
|
443
422
|
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
@@ -454,7 +433,7 @@ Layout/SpaceAfterColon:
|
|
454
433
|
Exclude:
|
455
434
|
- 'spec/dummy/app/controllers/included_param_group_controller.rb'
|
456
435
|
|
457
|
-
# Offense count:
|
436
|
+
# Offense count: 41
|
458
437
|
# This cop supports safe autocorrection (--autocorrect).
|
459
438
|
Layout/SpaceAfterComma:
|
460
439
|
Exclude:
|
@@ -490,8 +469,9 @@ Layout/SpaceAfterNot:
|
|
490
469
|
|
491
470
|
# Offense count: 142
|
492
471
|
# This cop supports safe autocorrection (--autocorrect).
|
493
|
-
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
|
472
|
+
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
|
494
473
|
# SupportedStylesForExponentOperator: space, no_space
|
474
|
+
# SupportedStylesForRationalLiterals: space, no_space
|
495
475
|
Layout/SpaceAroundOperators:
|
496
476
|
Exclude:
|
497
477
|
- 'app/controllers/apipie/apipies_controller.rb'
|
@@ -505,7 +485,7 @@ Layout/SpaceAroundOperators:
|
|
505
485
|
- 'spec/lib/swagger/rake_swagger_spec.rb'
|
506
486
|
- 'spec/lib/swagger/swagger_dsl_spec.rb'
|
507
487
|
|
508
|
-
# Offense count:
|
488
|
+
# Offense count: 29
|
509
489
|
# This cop supports safe autocorrection (--autocorrect).
|
510
490
|
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
511
491
|
# SupportedStyles: space, no_space
|
@@ -518,9 +498,6 @@ Layout/SpaceBeforeBlockBraces:
|
|
518
498
|
- 'lib/apipie/param_description.rb'
|
519
499
|
- 'lib/apipie/response_description.rb'
|
520
500
|
- 'lib/apipie/routes_formatter.rb'
|
521
|
-
- 'lib/tasks/apipie.rake'
|
522
|
-
- 'spec/controllers/users_controller_spec.rb'
|
523
|
-
- 'spec/dummy/app/controllers/pets_using_auto_views_controller.rb'
|
524
501
|
- 'spec/lib/swagger/swagger_dsl_spec.rb'
|
525
502
|
|
526
503
|
# Offense count: 4
|
@@ -540,7 +517,7 @@ Layout/SpaceInsideArrayLiteralBrackets:
|
|
540
517
|
- 'lib/apipie/generator/swagger/param_description/composite.rb'
|
541
518
|
- 'spec/controllers/users_controller_spec.rb'
|
542
519
|
|
543
|
-
# Offense count:
|
520
|
+
# Offense count: 60
|
544
521
|
# This cop supports safe autocorrection (--autocorrect).
|
545
522
|
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
546
523
|
# SupportedStyles: space, no_space
|
@@ -553,9 +530,7 @@ Layout/SpaceInsideBlockBraces:
|
|
553
530
|
- 'lib/apipie/response_description.rb'
|
554
531
|
- 'lib/apipie/routes_formatter.rb'
|
555
532
|
- 'lib/apipie/validator.rb'
|
556
|
-
- 'lib/tasks/apipie.rake'
|
557
533
|
- 'spec/controllers/users_controller_spec.rb'
|
558
|
-
- 'spec/dummy/app/controllers/pets_using_auto_views_controller.rb'
|
559
534
|
- 'spec/lib/apipie/application_spec.rb'
|
560
535
|
- 'spec/lib/apipie/generator/swagger/operation_id_spec.rb'
|
561
536
|
- 'spec/lib/apipie/generator/swagger/warning_spec.rb'
|
@@ -618,12 +593,11 @@ Layout/TrailingEmptyLines:
|
|
618
593
|
- 'spec/lib/apipie/generator/swagger/param_description_spec.rb'
|
619
594
|
- 'spec/lib/apipie/param_group_spec.rb'
|
620
595
|
|
621
|
-
# Offense count:
|
596
|
+
# Offense count: 14
|
622
597
|
# This cop supports safe autocorrection (--autocorrect).
|
623
598
|
# Configuration parameters: AllowInHeredoc.
|
624
599
|
Layout/TrailingWhitespace:
|
625
600
|
Exclude:
|
626
|
-
- 'lib/apipie/error_description.rb'
|
627
601
|
- 'spec/dummy/app/controllers/application_controller.rb'
|
628
602
|
- 'spec/dummy/app/controllers/twitter_example_controller.rb'
|
629
603
|
|
@@ -726,27 +700,24 @@ Lint/UnderscorePrefixedVariableName:
|
|
726
700
|
- 'lib/apipie/application.rb'
|
727
701
|
- 'lib/apipie/dsl_definition.rb'
|
728
702
|
|
729
|
-
# Offense count:
|
703
|
+
# Offense count: 22
|
730
704
|
# This cop supports safe autocorrection (--autocorrect).
|
731
|
-
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
|
705
|
+
# Configuration parameters: AutoCorrect, IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
|
732
706
|
Lint/UnusedBlockArgument:
|
733
707
|
Exclude:
|
734
708
|
- 'lib/apipie/configuration.rb'
|
735
|
-
- 'lib/apipie/extractor/collector.rb'
|
736
|
-
- 'lib/apipie/extractor/recorder.rb'
|
737
709
|
- 'lib/apipie/param_description.rb'
|
738
710
|
- 'lib/apipie/resource_description.rb'
|
739
711
|
- 'lib/apipie/rspec/response_validation_helper.rb'
|
740
712
|
- 'lib/tasks/apipie.rake'
|
741
713
|
- 'spec/controllers/users_controller_spec.rb'
|
742
714
|
- 'spec/lib/apipie/apipies_controller_spec.rb'
|
743
|
-
- 'spec/lib/apipie/extractor_spec.rb'
|
744
715
|
- 'spec/lib/swagger/swagger_dsl_spec.rb'
|
745
716
|
- 'spec/spec_helper.rb'
|
746
717
|
|
747
718
|
# Offense count: 24
|
748
719
|
# This cop supports safe autocorrection (--autocorrect).
|
749
|
-
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
|
720
|
+
# Configuration parameters: AutoCorrect, AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
|
750
721
|
Lint/UnusedMethodArgument:
|
751
722
|
Exclude:
|
752
723
|
- 'lib/apipie/dsl_definition.rb'
|
@@ -757,6 +728,7 @@ Lint/UnusedMethodArgument:
|
|
757
728
|
|
758
729
|
# Offense count: 5
|
759
730
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
731
|
+
# Configuration parameters: AutoCorrect.
|
760
732
|
Lint/UselessAssignment:
|
761
733
|
Exclude:
|
762
734
|
- 'lib/apipie/application.rb'
|
@@ -766,24 +738,26 @@ Lint/UselessAssignment:
|
|
766
738
|
|
767
739
|
# Offense count: 2
|
768
740
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
741
|
+
# Configuration parameters: AutoCorrect.
|
769
742
|
Lint/UselessMethodDefinition:
|
770
743
|
Exclude:
|
771
744
|
- 'spec/dummy/app/controllers/overridden_concerns_controller.rb'
|
772
745
|
|
773
|
-
# Offense count:
|
746
|
+
# Offense count: 4
|
774
747
|
# This cop supports safe autocorrection (--autocorrect).
|
775
|
-
# Configuration parameters: CheckForMethodsWithNoSideEffects.
|
748
|
+
# Configuration parameters: AutoCorrect, CheckForMethodsWithNoSideEffects.
|
776
749
|
Lint/Void:
|
777
750
|
Exclude:
|
778
751
|
- 'spec/controllers/users_controller_spec.rb'
|
752
|
+
- 'spec/lib/swagger/swagger_dsl_spec.rb'
|
779
753
|
|
780
754
|
# Offense count: 60
|
781
755
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
782
756
|
Metrics/AbcSize:
|
783
757
|
Max: 96
|
784
758
|
|
785
|
-
# Offense count:
|
786
|
-
# Configuration parameters: CountBlocks.
|
759
|
+
# Offense count: 1
|
760
|
+
# Configuration parameters: CountBlocks, CountModifierForms.
|
787
761
|
Metrics/BlockNesting:
|
788
762
|
Max: 4
|
789
763
|
|
@@ -802,7 +776,7 @@ Metrics/MethodLength:
|
|
802
776
|
Metrics/ModuleLength:
|
803
777
|
Max: 119
|
804
778
|
|
805
|
-
# Offense count:
|
779
|
+
# Offense count: 5
|
806
780
|
# Configuration parameters: CountKeywordArgs.
|
807
781
|
Metrics/ParameterLists:
|
808
782
|
MaxOptionalParameters: 5
|
@@ -917,13 +891,6 @@ Performance/RedundantMerge:
|
|
917
891
|
- 'lib/apipie/generator/swagger/param_description/type.rb'
|
918
892
|
- 'lib/apipie/middleware/checksum_in_headers.rb'
|
919
893
|
|
920
|
-
# Offense count: 7
|
921
|
-
# This cop supports safe autocorrection (--autocorrect).
|
922
|
-
Performance/RegexpMatch:
|
923
|
-
Exclude:
|
924
|
-
- 'lib/apipie/extractor/writer.rb'
|
925
|
-
- 'lib/apipie/helpers.rb'
|
926
|
-
|
927
894
|
# Offense count: 7
|
928
895
|
# This cop supports safe autocorrection (--autocorrect).
|
929
896
|
Performance/StringIdentifierArgument:
|
@@ -974,7 +941,7 @@ RSpec/BeforeAfterAll:
|
|
974
941
|
Exclude:
|
975
942
|
- 'spec/controllers/users_controller_spec.rb'
|
976
943
|
|
977
|
-
# Offense count:
|
944
|
+
# Offense count: 54
|
978
945
|
# Configuration parameters: Prefixes, AllowedPatterns.
|
979
946
|
# Prefixes: when, with, without
|
980
947
|
RSpec/ContextWording:
|
@@ -1004,7 +971,7 @@ RSpec/DescribeClass:
|
|
1004
971
|
|
1005
972
|
# Offense count: 75
|
1006
973
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
1007
|
-
# Configuration parameters: SkipBlocks, EnforcedStyle.
|
974
|
+
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
|
1008
975
|
# SupportedStyles: described_class, explicit
|
1009
976
|
RSpec/DescribedClass:
|
1010
977
|
Exclude:
|
@@ -1024,6 +991,7 @@ RSpec/DescribedClass:
|
|
1024
991
|
|
1025
992
|
# Offense count: 1
|
1026
993
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
994
|
+
# Configuration parameters: AutoCorrect.
|
1027
995
|
RSpec/EmptyExampleGroup:
|
1028
996
|
Exclude:
|
1029
997
|
- 'spec/lib/apipie/generator/swagger/param_description/composite_spec.rb'
|
@@ -1047,33 +1015,11 @@ RSpec/EmptyLineAfterHook:
|
|
1047
1015
|
Exclude:
|
1048
1016
|
- 'spec/lib/apipie/apipies_controller_spec.rb'
|
1049
1017
|
|
1050
|
-
# Offense count:
|
1018
|
+
# Offense count: 55
|
1051
1019
|
# Configuration parameters: CountAsOne.
|
1052
1020
|
RSpec/ExampleLength:
|
1053
1021
|
Max: 85
|
1054
1022
|
|
1055
|
-
# Offense count: 159
|
1056
|
-
# This cop supports safe autocorrection (--autocorrect).
|
1057
|
-
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
|
1058
|
-
# DisallowedExamples: works
|
1059
|
-
RSpec/ExampleWording:
|
1060
|
-
Exclude:
|
1061
|
-
- 'spec/controllers/api/v1/architectures_controller_spec.rb'
|
1062
|
-
- 'spec/controllers/api/v2/nested/resources_controller_spec.rb'
|
1063
|
-
- 'spec/controllers/concerns_controller_spec.rb'
|
1064
|
-
- 'spec/controllers/extended_controller_spec.rb'
|
1065
|
-
- 'spec/controllers/included_param_group_controller_spec.rb'
|
1066
|
-
- 'spec/controllers/users_controller_spec.rb'
|
1067
|
-
- 'spec/lib/apipie/application_spec.rb'
|
1068
|
-
- 'spec/lib/apipie/extractor/writer_spec.rb'
|
1069
|
-
- 'spec/lib/apipie/method_description_spec.rb'
|
1070
|
-
- 'spec/lib/apipie/param_description_spec.rb'
|
1071
|
-
- 'spec/lib/apipie/param_group_spec.rb'
|
1072
|
-
- 'spec/lib/apipie/resource_description_spec.rb'
|
1073
|
-
- 'spec/lib/apipie/validator_spec.rb'
|
1074
|
-
- 'spec/lib/swagger/swagger_dsl_spec.rb'
|
1075
|
-
- 'spec/test_engine/memes_controller_spec.rb'
|
1076
|
-
|
1077
1023
|
# Offense count: 1
|
1078
1024
|
# This cop supports safe autocorrection (--autocorrect).
|
1079
1025
|
RSpec/ExcessiveDocstringSpacing:
|
@@ -1095,6 +1041,7 @@ RSpec/HookArgument:
|
|
1095
1041
|
|
1096
1042
|
# Offense count: 3
|
1097
1043
|
# This cop supports safe autocorrection (--autocorrect).
|
1044
|
+
# Configuration parameters: AutoCorrect.
|
1098
1045
|
RSpec/HooksBeforeExamples:
|
1099
1046
|
Exclude:
|
1100
1047
|
- 'spec/controllers/users_controller_spec.rb'
|
@@ -1141,7 +1088,7 @@ RSpec/MessageSpies:
|
|
1141
1088
|
RSpec/MultipleExpectations:
|
1142
1089
|
Max: 19
|
1143
1090
|
|
1144
|
-
# Offense count:
|
1091
|
+
# Offense count: 170
|
1145
1092
|
# Configuration parameters: AllowSubject.
|
1146
1093
|
RSpec/MultipleMemoizedHelpers:
|
1147
1094
|
Max: 15
|
@@ -1166,7 +1113,7 @@ RSpec/NamedSubject:
|
|
1166
1113
|
- 'spec/lib/swagger/rake_swagger_spec.rb'
|
1167
1114
|
- 'spec/lib/swagger/swagger_dsl_spec.rb'
|
1168
1115
|
|
1169
|
-
# Offense count:
|
1116
|
+
# Offense count: 99
|
1170
1117
|
# Configuration parameters: AllowedGroups.
|
1171
1118
|
RSpec/NestedGroups:
|
1172
1119
|
Max: 6
|
@@ -1205,13 +1152,6 @@ RSpec/PredicateMatcher:
|
|
1205
1152
|
- 'spec/lib/apipie/file_handler_spec.rb'
|
1206
1153
|
- 'spec/lib/swagger/swagger_dsl_spec.rb'
|
1207
1154
|
|
1208
|
-
# Offense count: 1
|
1209
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
1210
|
-
# Configuration parameters: Inferences.
|
1211
|
-
RSpec/Rails/InferredSpecType:
|
1212
|
-
Exclude:
|
1213
|
-
- 'spec/controllers/pets_controller_spec.rb'
|
1214
|
-
|
1215
1155
|
# Offense count: 2
|
1216
1156
|
RSpec/RepeatedExampleGroupBody:
|
1217
1157
|
Exclude:
|
@@ -1258,7 +1198,7 @@ Rails/Delegate:
|
|
1258
1198
|
Exclude:
|
1259
1199
|
- 'lib/apipie/response_description_adapter.rb'
|
1260
1200
|
|
1261
|
-
# Offense count:
|
1201
|
+
# Offense count: 25
|
1262
1202
|
# This cop supports safe autocorrection (--autocorrect).
|
1263
1203
|
# Configuration parameters: EnforcedStyle.
|
1264
1204
|
# SupportedStyles: slashes, arguments
|
@@ -1293,7 +1233,7 @@ Rails/NegateInclude:
|
|
1293
1233
|
- 'lib/apipie/extractor/writer.rb'
|
1294
1234
|
- 'spec/spec_helper.rb'
|
1295
1235
|
|
1296
|
-
# Offense count:
|
1236
|
+
# Offense count: 6
|
1297
1237
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
1298
1238
|
# Configuration parameters: Include.
|
1299
1239
|
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
|
@@ -1371,21 +1311,6 @@ Style/AndOr:
|
|
1371
1311
|
Exclude:
|
1372
1312
|
- 'lib/apipie/param_description.rb'
|
1373
1313
|
|
1374
|
-
# Offense count: 18
|
1375
|
-
# This cop supports safe autocorrection (--autocorrect).
|
1376
|
-
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
|
1377
|
-
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
|
1378
|
-
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
1379
|
-
# FunctionalMethods: let, let!, subject, watch
|
1380
|
-
# AllowedMethods: lambda, proc, it
|
1381
|
-
Style/BlockDelimiters:
|
1382
|
-
Exclude:
|
1383
|
-
- 'lib/tasks/apipie.rake'
|
1384
|
-
- 'spec/controllers/users_controller_spec.rb'
|
1385
|
-
- 'spec/dummy/app/controllers/pets_using_auto_views_controller.rb'
|
1386
|
-
- 'spec/lib/apipie/extractor/writer_spec.rb'
|
1387
|
-
- 'spec/lib/swagger/swagger_dsl_spec.rb'
|
1388
|
-
|
1389
1314
|
# Offense count: 1
|
1390
1315
|
# This cop supports safe autocorrection (--autocorrect).
|
1391
1316
|
# Configuration parameters: AllowOnConstant, AllowOnSelfClass.
|
@@ -1484,7 +1409,7 @@ Style/CommentedKeyword:
|
|
1484
1409
|
- 'lib/apipie/dsl_definition.rb'
|
1485
1410
|
- 'lib/apipie/extractor/recorder.rb'
|
1486
1411
|
|
1487
|
-
# Offense count:
|
1412
|
+
# Offense count: 7
|
1488
1413
|
# This cop supports safe autocorrection (--autocorrect).
|
1489
1414
|
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
|
1490
1415
|
# SupportedStyles: assign_to_condition, assign_inside_condition
|
@@ -1519,7 +1444,7 @@ Style/EmptyCaseCondition:
|
|
1519
1444
|
|
1520
1445
|
# Offense count: 3
|
1521
1446
|
# This cop supports safe autocorrection (--autocorrect).
|
1522
|
-
# Configuration parameters: EnforcedStyle, AllowComments.
|
1447
|
+
# Configuration parameters: AutoCorrect, EnforcedStyle, AllowComments.
|
1523
1448
|
# SupportedStyles: empty, nil, both
|
1524
1449
|
Style/EmptyElse:
|
1525
1450
|
Exclude:
|
@@ -1529,7 +1454,7 @@ Style/EmptyElse:
|
|
1529
1454
|
|
1530
1455
|
# Offense count: 27
|
1531
1456
|
# This cop supports safe autocorrection (--autocorrect).
|
1532
|
-
# Configuration parameters: EnforcedStyle.
|
1457
|
+
# Configuration parameters: AutoCorrect, EnforcedStyle.
|
1533
1458
|
# SupportedStyles: compact, expanded
|
1534
1459
|
Style/EmptyMethod:
|
1535
1460
|
Exclude:
|
@@ -1616,7 +1541,7 @@ Style/HashExcept:
|
|
1616
1541
|
# This cop supports safe autocorrection (--autocorrect).
|
1617
1542
|
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
1618
1543
|
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
1619
|
-
# SupportedShorthandSyntax: always, never, either, consistent
|
1544
|
+
# SupportedShorthandSyntax: always, never, either, consistent, either_consistent
|
1620
1545
|
Style/HashSyntax:
|
1621
1546
|
Exclude:
|
1622
1547
|
- 'spec/dummy/config/routes.rb'
|
@@ -1677,19 +1602,6 @@ Style/MultilineBlockChain:
|
|
1677
1602
|
Exclude:
|
1678
1603
|
- 'lib/apipie/param_description.rb'
|
1679
1604
|
|
1680
|
-
# Offense count: 7
|
1681
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
1682
|
-
# Configuration parameters: EnforcedStyle.
|
1683
|
-
# SupportedStyles: literals, strict
|
1684
|
-
Style/MutableConstant:
|
1685
|
-
Exclude:
|
1686
|
-
- 'lib/apipie/extractor/recorder.rb'
|
1687
|
-
- 'lib/apipie/generator/swagger/param_description/in.rb'
|
1688
|
-
- 'lib/apipie/generator/swagger/type_extractor.rb'
|
1689
|
-
- 'lib/apipie/generator/swagger/warning.rb'
|
1690
|
-
- 'lib/apipie/routes_formatter.rb'
|
1691
|
-
- 'lib/apipie/version.rb'
|
1692
|
-
|
1693
1605
|
# Offense count: 8
|
1694
1606
|
# This cop supports safe autocorrection (--autocorrect).
|
1695
1607
|
# Configuration parameters: EnforcedStyle.
|
@@ -1764,7 +1676,7 @@ Style/Proc:
|
|
1764
1676
|
- 'spec/lib/apipie/apipies_controller_spec.rb'
|
1765
1677
|
|
1766
1678
|
# Offense count: 7
|
1767
|
-
# This cop supports
|
1679
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
1768
1680
|
# Configuration parameters: EnforcedStyle, AllowedCompactTypes.
|
1769
1681
|
# SupportedStyles: compact, exploded
|
1770
1682
|
Style/RaiseArgs:
|
@@ -1921,7 +1833,7 @@ Style/StringConcatenation:
|
|
1921
1833
|
- 'lib/apipie/application.rb'
|
1922
1834
|
- 'lib/apipie/extractor/writer.rb'
|
1923
1835
|
|
1924
|
-
# Offense count:
|
1836
|
+
# Offense count: 1233
|
1925
1837
|
# This cop supports safe autocorrection (--autocorrect).
|
1926
1838
|
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
1927
1839
|
# SupportedStyles: single_quotes, double_quotes
|
@@ -2029,7 +1941,6 @@ Style/TrailingCommaInHashLiteral:
|
|
2029
1941
|
Exclude:
|
2030
1942
|
- 'lib/apipie/generator/swagger/param_description.rb'
|
2031
1943
|
- 'lib/apipie/generator/swagger/param_description/builder.rb'
|
2032
|
-
- 'lib/apipie/response_description.rb'
|
2033
1944
|
- 'spec/controllers/users_controller_spec.rb'
|
2034
1945
|
|
2035
1946
|
# Offense count: 1
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
Changelog
|
2
2
|
===========
|
3
3
|
|
4
|
+
## [v1.4.2](https://github.com/Apipie/apipie-rails/tree/v1.4.2) (2024-07-20)
|
5
|
+
[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v1.4.1...v1.4.2)
|
6
|
+
* Fix rubocop with most recent version 1.65.0 (#930) (Mathieu Jobin)
|
7
|
+
* Fix error for hash object warnings with delegated method descriptions (#938) (Murray Steele)
|
8
|
+
|
9
|
+
## [v1.4.1](https://github.com/Apipie/apipie-rails/tree/v1.4.1) (2024-07-09)
|
10
|
+
[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v1.4.0...v1.4.1)
|
11
|
+
* Fix multiple rubocop offenses via rubocop_challenger. (Mathieu Jobin)
|
12
|
+
* RSpec/ExampleWording (#913)
|
13
|
+
* Layout/FirstArrayElementIndentation (#914)
|
14
|
+
* Style/BlockDelimiters (#917)
|
15
|
+
* Style/MutableConstant (#916)
|
16
|
+
* Layout/InitialIndentation (#915)
|
17
|
+
* Performance/RegexpMatch (#918)
|
18
|
+
* Fix CI: build green for modern ruby, rack, and rubocop-rspec (#939) (Murray Steele)
|
19
|
+
|
4
20
|
## [v1.4.0](https://github.com/Apipie/apipie-rails/tree/v1.4.0) (2024-05-30)
|
5
21
|
[Full Changelog](https://github.com/Apipie/apipie-rails/compare/v1.3.0...v1.4.0)
|
6
22
|
* Add Ruby 3.3.0 to CI build matrix (#906) Masato Nakamura
|
data/apipie-rails.gemspec
CHANGED
@@ -38,6 +38,7 @@ Gem::Specification.new do |s|
|
|
38
38
|
s.add_development_dependency 'rubocop-rails'
|
39
39
|
s.add_development_dependency 'rubocop-rspec'
|
40
40
|
s.add_development_dependency 'rubocop-performance'
|
41
|
+
s.add_development_dependency 'rubocop-rspec_rails' if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7")
|
41
42
|
s.add_development_dependency "simplecov"
|
42
43
|
s.add_development_dependency "sqlite3"
|
43
44
|
end
|
data/lib/apipie/application.rb
CHANGED
@@ -281,12 +281,12 @@ module Apipie
|
|
281
281
|
|
282
282
|
resources =
|
283
283
|
Apipie::Generator::Swagger::ResourceDescriptionsCollection
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
284
|
+
.new(resource_descriptions)
|
285
|
+
.filter(
|
286
|
+
resource_id: resource_id,
|
287
|
+
method_name: method_name,
|
288
|
+
version: version
|
289
|
+
)
|
290
290
|
|
291
291
|
Apipie::SwaggerGenerator.generate_from_resources(
|
292
292
|
resources,
|
@@ -5,9 +5,7 @@ module Apipie
|
|
5
5
|
|
6
6
|
def self.from_dsl_data(args)
|
7
7
|
code_or_options, desc, options = args
|
8
|
-
Apipie::ErrorDescription.new(code_or_options,
|
9
|
-
desc,
|
10
|
-
options)
|
8
|
+
Apipie::ErrorDescription.new(code_or_options, desc, options)
|
11
9
|
end
|
12
10
|
|
13
11
|
def initialize(code_or_options, desc = nil, options = {})
|
@@ -17,9 +15,13 @@ module Apipie
|
|
17
15
|
@metadata = code_or_options[:meta]
|
18
16
|
@description = code_or_options[:desc] || code_or_options[:description]
|
19
17
|
else
|
20
|
-
@code =
|
18
|
+
@code =
|
21
19
|
if code_or_options.is_a? Symbol
|
22
|
-
|
20
|
+
begin
|
21
|
+
Rack::Utils.status_code(code_or_options)
|
22
|
+
rescue ArgumentError
|
23
|
+
nil
|
24
|
+
end
|
23
25
|
else
|
24
26
|
code_or_options
|
25
27
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Apipie
|
2
2
|
module Extractor
|
3
3
|
class Recorder
|
4
|
-
MULTIPART_BOUNDARY = 'APIPIE_RECORDER_EXAMPLE_BOUNDARY'
|
4
|
+
MULTIPART_BOUNDARY = 'APIPIE_RECORDER_EXAMPLE_BOUNDARY'.freeze
|
5
5
|
|
6
6
|
def initialize
|
7
7
|
@ignored_params = [:controller, :action]
|
@@ -14,12 +14,12 @@ module Apipie
|
|
14
14
|
@params = Rack::Utils.parse_nested_query(@query)
|
15
15
|
@params.merge!(env["action_dispatch.request.request_parameters"] || {})
|
16
16
|
rack_input = env["rack.input"]
|
17
|
-
if data = parse_data(rack_input
|
17
|
+
if data = parse_data(rack_input&.read)
|
18
18
|
@request_data = data
|
19
19
|
elsif form_hash = env["rack.request.form_hash"]
|
20
20
|
@request_data = reformat_multipart_data(form_hash)
|
21
21
|
end
|
22
|
-
rack_input
|
22
|
+
rack_input&.rewind
|
23
23
|
end
|
24
24
|
|
25
25
|
def analyse_controller(controller)
|