apipie-rails 0.5.19 → 1.3.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/build.yml +31 -0
- data/.github/workflows/rubocop-challenger.yml +28 -0
- data/.github/workflows/rubocop.yml +18 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +128 -0
- data/.rubocop_todo.yml +2056 -0
- data/.vscode/settings.json +3 -0
- data/CHANGELOG.md +161 -0
- data/Gemfile +20 -0
- data/README.rst +117 -23
- data/Rakefile +0 -5
- data/apipie-rails.gemspec +18 -9
- data/app/controllers/apipie/apipies_controller.rb +14 -29
- data/app/helpers/apipie_helper.rb +1 -1
- data/app/public/apipie/javascripts/bundled/bootstrap-collapse.js +70 -41
- data/app/public/apipie/javascripts/bundled/bootstrap.js +1033 -479
- data/app/public/apipie/javascripts/bundled/jquery.js +5 -5
- data/app/public/apipie/stylesheets/bundled/bootstrap-responsive.min.css +9 -12
- data/app/public/apipie/stylesheets/bundled/bootstrap.min.css +9 -689
- data/app/views/apipie/apipies/_deprecation.html.erb +16 -0
- data/app/views/apipie/apipies/_params.html.erb +7 -1
- data/config/locales/en.yml +8 -0
- data/config/locales/ko.yml +31 -0
- data/gemfiles/Gemfile.tools +9 -0
- data/lib/apipie/apipie_module.rb +7 -7
- data/lib/apipie/application.rb +132 -97
- data/lib/apipie/configuration.rb +43 -33
- data/lib/apipie/dsl_definition.rb +44 -33
- data/lib/apipie/error_description.rb +3 -3
- data/lib/apipie/errors.rb +17 -17
- data/lib/apipie/extractor/collector.rb +5 -6
- data/lib/apipie/extractor/recorder.rb +35 -8
- data/lib/apipie/extractor/writer.rb +15 -15
- data/lib/apipie/extractor.rb +6 -9
- data/lib/apipie/generator/config.rb +12 -0
- data/lib/apipie/generator/generator.rb +2 -0
- data/lib/apipie/generator/swagger/computed_interface_id.rb +23 -0
- data/lib/apipie/generator/swagger/config.rb +80 -0
- data/lib/apipie/generator/swagger/context.rb +38 -0
- data/lib/apipie/generator/swagger/method_description/api_decorator.rb +20 -0
- data/lib/apipie/generator/swagger/method_description/api_schema_service.rb +89 -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 +51 -0
- data/lib/apipie/generator/swagger/param_description/builder.rb +114 -0
- data/lib/apipie/generator/swagger/param_description/composite.rb +119 -0
- data/lib/apipie/generator/swagger/param_description/description.rb +15 -0
- data/lib/apipie/generator/swagger/param_description/in.rb +37 -0
- data/lib/apipie/generator/swagger/param_description/name.rb +18 -0
- 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 +128 -0
- data/lib/apipie/generator/swagger/param_description.rb +18 -0
- 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/swagger.rb +2 -0
- data/lib/apipie/generator/swagger/type.rb +16 -0
- data/lib/apipie/generator/swagger/type_extractor.rb +51 -0
- data/lib/apipie/generator/swagger/warning.rb +74 -0
- data/lib/apipie/generator/swagger/warning_writer.rb +54 -0
- data/lib/apipie/helpers.rb +3 -3
- data/lib/apipie/markup.rb +9 -8
- data/lib/apipie/method_description/api.rb +12 -0
- data/lib/apipie/method_description/apis_service.rb +82 -0
- data/lib/apipie/method_description.rb +12 -56
- data/lib/apipie/param_description/deprecation.rb +24 -0
- data/lib/apipie/param_description.rb +57 -24
- data/lib/apipie/resource_description.rb +42 -14
- data/lib/apipie/response_description.rb +3 -3
- data/lib/apipie/response_description_adapter.rb +12 -10
- data/lib/apipie/routing.rb +1 -1
- data/lib/apipie/rspec/response_validation_helper.rb +3 -3
- data/lib/apipie/static_dispatcher.rb +10 -2
- data/lib/apipie/swagger_generator.rb +28 -691
- data/lib/apipie/validator.rb +41 -11
- data/lib/apipie/version.rb +1 -1
- data/lib/apipie-rails.rb +36 -5
- data/lib/generators/apipie/install/install_generator.rb +1 -1
- data/lib/generators/apipie/views_generator.rb +1 -1
- data/lib/tasks/apipie.rake +37 -32
- data/rel-eng/gem_release.ipynb +41 -9
- data/spec/controllers/api/v2/architectures_controller_spec.rb +10 -3
- data/spec/controllers/api/v2/empty_middle_controller_spec.rb +23 -0
- data/spec/controllers/api/v2/nested/resources_controller_spec.rb +18 -2
- data/spec/controllers/api/v2/sub/footguns_controller_spec.rb +19 -0
- data/spec/controllers/included_param_group_controller_spec.rb +13 -0
- data/spec/{lib/swagger/response_validation_spec.rb → controllers/pets_controller_spec.rb} +26 -32
- data/spec/controllers/users_controller_spec.rb +47 -6
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/app/controllers/api/v2/architectures_controller.rb +2 -1
- data/spec/dummy/app/controllers/api/v2/base_controller.rb +6 -0
- data/spec/dummy/app/controllers/api/v2/empty_middle_controller.rb +14 -0
- data/spec/dummy/app/controllers/api/v2/nested/resources_controller.rb +2 -2
- data/spec/dummy/app/controllers/api/v2/sub/footguns_controller.rb +30 -0
- data/spec/dummy/app/controllers/concerns_controller.rb +1 -1
- data/spec/dummy/app/controllers/{concerns/extending_concern.rb → extending_concern.rb} +0 -2
- data/spec/dummy/app/controllers/included_param_group_controller.rb +19 -0
- data/spec/dummy/app/controllers/overridden_concerns_controller.rb +2 -2
- data/spec/dummy/app/controllers/pets_controller.rb +5 -5
- data/spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb +2 -2
- data/spec/dummy/app/controllers/{concerns/sample_controller.rb → sample_controller.rb} +0 -2
- data/spec/dummy/app/controllers/twitter_example_controller.rb +2 -2
- data/spec/dummy/app/controllers/users_controller.rb +17 -5
- data/spec/dummy/app/helpers/random_param_group.rb +8 -0
- data/spec/dummy/components/test_engine/test_engine.gemspec +1 -1
- data/spec/dummy/config/application.rb +2 -5
- data/spec/dummy/config/boot.rb +2 -2
- data/spec/dummy/config/environment.rb +1 -1
- data/spec/dummy/config/environments/development.rb +0 -3
- data/spec/dummy/config/environments/production.rb +0 -3
- data/spec/dummy/config/environments/test.rb +0 -5
- data/spec/dummy/config/initializers/apipie.rb +2 -2
- data/spec/dummy/config/routes.rb +8 -0
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/script/rails +2 -2
- data/spec/{controllers → lib/apipie}/apipies_controller_spec.rb +95 -23
- data/spec/lib/apipie/application_spec.rb +62 -0
- data/spec/lib/apipie/configuration_spec.rb +38 -0
- data/spec/lib/apipie/extractor/collector_spec.rb +57 -0
- data/spec/lib/apipie/extractor/recorder_spec.rb +77 -0
- data/spec/lib/{extractor → apipie/extractor}/writer_spec.rb +8 -6
- data/spec/lib/{extractor → apipie}/extractor_spec.rb +1 -1
- data/spec/lib/{file_handler_spec.rb → apipie/file_handler_spec.rb} +7 -0
- data/spec/lib/apipie/generator/swagger/config_spec.rb +19 -0
- data/spec/lib/apipie/generator/swagger/context_spec.rb +56 -0
- data/spec/lib/apipie/generator/swagger/method_description/api_schema_service_spec.rb +119 -0
- data/spec/lib/apipie/generator/swagger/method_description/response_schema_service_spec.rb +105 -0
- data/spec/lib/apipie/generator/swagger/operation_id_spec.rb +63 -0
- data/spec/lib/apipie/generator/swagger/param_description/builder_spec.rb +215 -0
- data/spec/lib/apipie/generator/swagger/param_description/composite_spec.rb +95 -0
- data/spec/lib/apipie/generator/swagger/param_description/description_spec.rb +79 -0
- data/spec/lib/apipie/generator/swagger/param_description/in_spec.rb +86 -0
- data/spec/lib/apipie/generator/swagger/param_description/name_spec.rb +81 -0
- data/spec/lib/apipie/generator/swagger/param_description/type_spec.rb +183 -0
- data/spec/lib/apipie/generator/swagger/param_description_spec.rb +28 -0
- 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 +38 -0
- data/spec/lib/apipie/generator/swagger/warning_spec.rb +51 -0
- data/spec/lib/apipie/generator/swagger/warning_writer_spec.rb +71 -0
- data/spec/lib/apipie/method_description/apis_service_spec.rb +60 -0
- data/spec/lib/apipie/method_description_spec.rb +133 -0
- data/spec/lib/apipie/no_documented_method_spec.rb +17 -0
- data/spec/lib/apipie/param_description/deprecation_spec.rb +31 -0
- data/spec/lib/{param_description_spec.rb → apipie/param_description_spec.rb} +332 -6
- data/spec/lib/{param_group_spec.rb → apipie/param_group_spec.rb} +6 -5
- data/spec/lib/apipie/resource_description_spec.rb +91 -0
- 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/{validator_spec.rb → apipie/validator_spec.rb} +48 -12
- data/spec/lib/rake_spec.rb +3 -5
- data/spec/lib/swagger/openapi_2_0_schema.json +8 -1
- data/spec/lib/swagger/rake_swagger_spec.rb +30 -10
- data/spec/lib/swagger/swagger_dsl_spec.rb +18 -12
- data/spec/lib/validators/array_validator_spec.rb +1 -1
- data/spec/spec_helper.rb +10 -32
- data/spec/support/custom_bool_validator.rb +17 -0
- data/spec/{controllers → test_engine}/memes_controller_spec.rb +1 -1
- metadata +173 -125
- data/.travis.yml +0 -41
- data/Gemfile +0 -1
- data/Gemfile.rails41 +0 -7
- data/Gemfile.rails42 +0 -14
- data/Gemfile.rails50 +0 -9
- data/Gemfile.rails51 +0 -9
- data/Gemfile.rails60 +0 -10
- data/Gemfile.rails61 +0 -10
- data/spec/lib/application_spec.rb +0 -49
- data/spec/lib/method_description_spec.rb +0 -98
- data/spec/lib/resource_description_spec.rb +0 -48
- /data/spec/lib/{extractor → apipie/extractor/recorder}/middleware_spec.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51731d3325c2241c36c5cf0e19062525d982c2b98fa0d5e0b76a5ba8625ddacd
|
4
|
+
data.tar.gz: 45db678d7324e76064a8d8a632ac5e72048d85ba7d32329168202bd48723219b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dc8a4c009d6dc3daee4ac98d2509d832edbf2dc8d9ec08a9f9205d9ef7614c0480ed60132f33116c6a09dd9a0ec3b056c60fc52e3e6a61b6cf67eb913985619
|
7
|
+
data.tar.gz: 4621285ca2c82670ec63c0b5a240b0d6024d37e445c724a243782e492c5c6be65091187ee07ef874ff7d0320d68109577277d885b8ea4a28e2aed8c2a94490cf
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: build
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-20.04
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
rails: ["7.1", "7.0", "6.1", "6.0"]
|
12
|
+
ruby: ["3.2.2", "3.1.4", "3.0.6", "2.7.8"]
|
13
|
+
include:
|
14
|
+
- rails: "5.2"
|
15
|
+
ruby: "2.7.8"
|
16
|
+
- rails: "5.1"
|
17
|
+
ruby: "2.6.10"
|
18
|
+
- rails: "5.0"
|
19
|
+
ruby: "2.6.10"
|
20
|
+
|
21
|
+
env:
|
22
|
+
RUBY_VERSION: ${{ matrix.ruby }}
|
23
|
+
RAILS_VERSION: ${{ matrix.rails }}
|
24
|
+
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v2
|
27
|
+
- uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby }}
|
30
|
+
bundler-cache: true
|
31
|
+
- run: bundle exec rspec
|
@@ -0,0 +1,28 @@
|
|
1
|
+
name: "RuboCop Challenge"
|
2
|
+
|
3
|
+
on:
|
4
|
+
schedule:
|
5
|
+
- cron: '30 23 * * 1,3,5' # Monday, Wednesday, Friday at 23:30 UTC
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
create-pr:
|
9
|
+
name: Create Pull Request
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
env:
|
12
|
+
BUNDLE_GEMFILE: gemfiles/Gemfile.rails50
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- name: Set up Ruby 3.2
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: 3.2
|
19
|
+
- name: Install bundler
|
20
|
+
run: gem install bundler
|
21
|
+
- name: Install gems
|
22
|
+
run: bundle install --jobs 4 --retry 3
|
23
|
+
- name: Set git configuration
|
24
|
+
run: git config remote.origin.url "git@github.com:Apipie/apipie-rails.git"
|
25
|
+
- name: Create RuboCop challenge pull request
|
26
|
+
env:
|
27
|
+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
28
|
+
run: bundle exec rubocop_challenger go --exclude-limit=180 --base-branch=master --email=rubocop@payrollhero.com --name="Rubocop Challenger" --mode=random
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: RuboCop
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v3
|
10
|
+
|
11
|
+
- name: Set up Ruby 3.2
|
12
|
+
uses: ruby/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: 3.2
|
15
|
+
bundler-cache: true
|
16
|
+
|
17
|
+
- name: Run rubocop
|
18
|
+
run: bundle exec rubocop --config .rubocop.yml
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-rails
|
3
|
+
- rubocop-rspec
|
4
|
+
- rubocop-performance
|
5
|
+
|
6
|
+
inherit_from: .rubocop_todo.yml
|
7
|
+
|
8
|
+
Rails:
|
9
|
+
Enabled: true
|
10
|
+
|
11
|
+
AllCops:
|
12
|
+
NewCops: enable
|
13
|
+
TargetRubyVersion: 2.6
|
14
|
+
|
15
|
+
Layout/LineLength:
|
16
|
+
Max: 140
|
17
|
+
Exclude:
|
18
|
+
- app/controllers/apipie/apipies_controller.rb
|
19
|
+
- lib/apipie/extractor/writer.rb
|
20
|
+
- lib/apipie/param_description.rb
|
21
|
+
- lib/apipie/response_description_adapter.rb
|
22
|
+
- lib/apipie/swagger_generator.rb
|
23
|
+
- lib/apipie/errors.rb
|
24
|
+
- lib/apipie/generator/swagger/warning.rb
|
25
|
+
- lib/apipie/rspec/response_validation_helper.rb
|
26
|
+
- spec/controllers/pets_controller_spec.rb
|
27
|
+
- spec/controllers/users_controller_spec.rb
|
28
|
+
- spec/dummy/app/controllers/twitter_example_controller.rb
|
29
|
+
- spec/dummy/config/initializers/secret_token.rb
|
30
|
+
- spec/lib/application_spec.rb
|
31
|
+
- spec/lib/param_description_spec.rb
|
32
|
+
- spec/lib/param_description_deprecation_spec.rb
|
33
|
+
- spec/lib/swagger/response_validation_spec.rb
|
34
|
+
- spec/spec_helper.rb
|
35
|
+
|
36
|
+
Metrics/ClassLength:
|
37
|
+
Max: 180
|
38
|
+
Exclude:
|
39
|
+
- lib/apipie/extractor/writer.rb
|
40
|
+
- lib/apipie/application.rb
|
41
|
+
- lib/apipie/param_description.rb
|
42
|
+
- lib/apipie/method_description.rb
|
43
|
+
- lib/apipie/swagger_generator.rb
|
44
|
+
- spec/dummy/app/controllers/pets_controller.rb
|
45
|
+
- spec/dummy/app/controllers/twitter_example_controller.rb
|
46
|
+
- spec/dummy/app/controllers/users_controller.rb
|
47
|
+
|
48
|
+
Metrics/BlockLength:
|
49
|
+
Max: 26 # default
|
50
|
+
Exclude:
|
51
|
+
- app/controllers/apipie/apipies_controller.rb
|
52
|
+
- lib/apipie/generator/swagger/param_description/composite.rb
|
53
|
+
- lib/apipie/generator/swagger/param_description/path_params_composite.rb
|
54
|
+
- lib/tasks/apipie.rake
|
55
|
+
- lib/apipie/swagger_generator.rb
|
56
|
+
|
57
|
+
Naming/PredicateName:
|
58
|
+
AllowedMethods:
|
59
|
+
- have_field?
|
60
|
+
|
61
|
+
Style/IfUnlessModifier:
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
Style/NumericPredicate:
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
Style/HashSyntax:
|
68
|
+
EnforcedStyle: no_mixed_keys
|
69
|
+
EnforcedShorthandSyntax: never # consistent
|
70
|
+
|
71
|
+
Metrics/ParameterLists:
|
72
|
+
Exclude:
|
73
|
+
- "lib/apipie/generator/swagger/context.rb"
|
74
|
+
|
75
|
+
Style/Documentation:
|
76
|
+
Exclude:
|
77
|
+
- "app/controllers/apipie/apipies_controller.rb"
|
78
|
+
- "app/helpers/apipie_helper.rb"
|
79
|
+
- "lib/apipie/apipie_module.rb"
|
80
|
+
- "lib/apipie/application.rb"
|
81
|
+
- "lib/apipie/configuration.rb"
|
82
|
+
- "lib/apipie/core_ext/route.rb"
|
83
|
+
- "lib/apipie/dsl_definition.rb"
|
84
|
+
- "lib/apipie/error_description.rb"
|
85
|
+
- "lib/apipie/errors.rb"
|
86
|
+
- "lib/apipie/extractor.rb"
|
87
|
+
- "lib/apipie/extractor/collector.rb"
|
88
|
+
- "lib/apipie/extractor/recorder.rb"
|
89
|
+
- "lib/apipie/extractor/writer.rb"
|
90
|
+
- "lib/apipie/generator/generator.rb"
|
91
|
+
- "lib/apipie/generator/swagger/**/*"
|
92
|
+
- "lib/apipie/helpers.rb"
|
93
|
+
- "lib/apipie/markup.rb"
|
94
|
+
- "lib/apipie/method_description.rb"
|
95
|
+
- "lib/apipie/method_description/api.rb"
|
96
|
+
- "lib/apipie/middleware/checksum_in_headers.rb"
|
97
|
+
- "lib/apipie/railtie.rb"
|
98
|
+
- "lib/apipie/response_description.rb"
|
99
|
+
- "lib/apipie/response_description_adapter.rb"
|
100
|
+
- "lib/apipie/routes_formatter.rb"
|
101
|
+
- "lib/apipie/routing.rb"
|
102
|
+
- "lib/apipie/rspec/response_validation_helper.rb"
|
103
|
+
- "lib/apipie/swagger_generator.rb"
|
104
|
+
- "lib/apipie/see_description.rb"
|
105
|
+
- "lib/apipie/static_dispatcher.rb"
|
106
|
+
- "lib/apipie/tag_list_description.rb"
|
107
|
+
- "lib/apipie/validator.rb"
|
108
|
+
- "lib/generators/apipie/install/install_generator.rb"
|
109
|
+
- "lib/generators/apipie/views_generator.rb"
|
110
|
+
- spec/support/custom_bool_validator.rb
|
111
|
+
- spec/lib/validators/array_validator_spec.rb
|
112
|
+
- spec/dummy/**/*.rb
|
113
|
+
|
114
|
+
Style/FrozenStringLiteralComment:
|
115
|
+
Enabled: false
|
116
|
+
|
117
|
+
Style/InverseMethods:
|
118
|
+
Enabled: false
|
119
|
+
|
120
|
+
Naming/BlockForwarding:
|
121
|
+
EnforcedStyle: explicit
|
122
|
+
BlockForwardingName: block
|
123
|
+
|
124
|
+
Lint/MissingSuper:
|
125
|
+
Exclude:
|
126
|
+
- "lib/apipie/errors.rb"
|
127
|
+
- "lib/apipie/response_description_adapter.rb"
|
128
|
+
- "lib/apipie/validator.rb"
|