grape-swagger-rails 0.3.1 → 0.5.0
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/.github/workflows/danger.yml +19 -0
- data/.github/workflows/head.yml +32 -0
- data/.github/workflows/rubocop.yml +14 -0
- data/.github/workflows/test.yml +35 -0
- data/.rubocop.yml +7 -2
- data/.rubocop_todo.yml +103 -32
- data/CHANGELOG.md +25 -14
- data/Dangerfile +2 -0
- data/Gemfile +24 -16
- data/README.md +32 -2
- data/RELEASING.md +4 -5
- data/Rakefile +5 -9
- data/app/assets/config/grape_swagger_rails_manifest.js +2 -0
- data/app/controllers/grape_swagger_rails/application_controller.rb +4 -2
- data/app/views/grape_swagger_rails/application/index.html.erb +1 -1
- data/config/routes.rb +2 -0
- data/grape-swagger-rails.gemspec +13 -29
- data/lib/grape-swagger-rails/engine.rb +2 -0
- data/lib/grape-swagger-rails/version.rb +3 -1
- data/lib/grape-swagger-rails.rb +17 -14
- data/lib/script/rails +4 -2
- data/lib/tasks/swagger_ui.rake +6 -3
- data/spec/dummy/Rakefile +6 -3
- data/spec/dummy/app/api/api.rb +2 -0
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/javascripts/application.js +0 -2
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/controllers/welcome_controller.rb +3 -2
- data/spec/dummy/app/views/layouts/application.html.erb +1 -0
- data/spec/dummy/bin/rails +3 -5
- data/spec/dummy/bin/rake +2 -4
- data/spec/dummy/bin/setup +27 -0
- data/spec/dummy/config/application.rb +11 -10
- data/spec/dummy/config/boot.rb +4 -7
- data/spec/dummy/config/environment.rb +6 -2
- data/spec/dummy/config/environments/development.rb +40 -19
- data/spec/dummy/config/environments/production.rb +31 -31
- data/spec/dummy/config/environments/test.rb +30 -20
- data/spec/dummy/config/initializers/assets.rb +13 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +10 -0
- data/spec/dummy/config/initializers/inflections.rb +18 -0
- data/spec/dummy/config/initializers/swagger.rb +2 -0
- data/spec/dummy/config/routes.rb +2 -0
- data/spec/dummy/config.ru +6 -2
- data/spec/dummy/public/404.html +6 -6
- data/spec/dummy/public/422.html +6 -6
- data/spec/dummy/public/500.html +6 -6
- data/spec/features/grape-swagger-rails_spec.rb +5 -1
- data/spec/features/swagger_spec.rb +97 -35
- data/spec/features/welcome_spec.rb +3 -0
- data/spec/spec_helper.rb +4 -2
- data/spec/support/capybara.rb +3 -0
- data/spec/support/rails.rb +2 -0
- metadata +25 -340
- data/.travis.yml +0 -53
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/spring +0 -18
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -1
- data/spec/dummy/config/initializers/session_store.rb +0 -1
- data/spec/dummy/vendor/assets/javascripts/.keep +0 -0
- data/spec/dummy/vendor/assets/stylesheets/.keep +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4c9588b4ccf8e66253f11a742506fc512c9a70d4d0f32c8ec72db06bdc47af5
|
4
|
+
data.tar.gz: 3148cee4aad16dced2e22f6f8639e6daa1c3190fcb46c9bc1627cdc385861d9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91b7f33ff1190d15f16937087ca698a94e2daf43aed206b80821bbc879d1cdeac98e7fe151d1a5414fa50ae649adaa293d87ac0fd06135540903159ff8ed0e98
|
7
|
+
data.tar.gz: 69968abc92dc53117812b3901cb98baa72036496005fc5ba65fc7b759eb9a0e40536af7bbcd0f4cced9567a7e7687b53144bb18599731554569fd0f2f4938f50
|
@@ -0,0 +1,19 @@
|
|
1
|
+
name: Danger
|
2
|
+
on: [pull_request]
|
3
|
+
jobs:
|
4
|
+
lint:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
steps:
|
7
|
+
- uses: actions/checkout@v3
|
8
|
+
with:
|
9
|
+
fetch-depth: 0
|
10
|
+
- name: Set up Ruby
|
11
|
+
uses: ruby/setup-ruby@v1
|
12
|
+
with:
|
13
|
+
ruby-version: "2.7"
|
14
|
+
bundler-cache: true
|
15
|
+
- name: Run Danger
|
16
|
+
run: |
|
17
|
+
# the token is public, has public_repo scope and belongs to the grape-bot user owned by @dblock, this is ok
|
18
|
+
TOKEN=$(echo -n Z2hwX2lYb0dPNXNyejYzOFJyaTV3QUxUdkNiS1dtblFwZTFuRXpmMwo= | base64 --decode)
|
19
|
+
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose
|
@@ -0,0 +1,32 @@
|
|
1
|
+
name: Tests (HEAD)
|
2
|
+
on: [pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
continue-on-error: true
|
7
|
+
strategy:
|
8
|
+
fail-fast: false
|
9
|
+
matrix:
|
10
|
+
entry:
|
11
|
+
- { ruby: "3.2", grape-swagger: "HEAD" }
|
12
|
+
- { ruby: "ruby-head", grape-swagger: "HEAD" }
|
13
|
+
- { ruby: "jruby-head", grape-swagger: "HEAD" }
|
14
|
+
env:
|
15
|
+
GRAPE_SWAGGER_VERSION: ${{ matrix.entry.grape-swagger }}
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v3
|
18
|
+
- name: Set up Ruby
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.entry.ruby }}
|
22
|
+
bundler-cache: true
|
23
|
+
- name: Setup Firefox
|
24
|
+
uses: browser-actions/setup-firefox@v1
|
25
|
+
with:
|
26
|
+
firefox-version: "111.0.1"
|
27
|
+
- uses: browser-actions/setup-geckodriver@latest
|
28
|
+
with:
|
29
|
+
geckodriver-version: "0.32.2"
|
30
|
+
- uses: coactions/setup-xvfb@v1
|
31
|
+
with:
|
32
|
+
run: bundle exec rake spec
|
@@ -0,0 +1,14 @@
|
|
1
|
+
name: Rubocop
|
2
|
+
on: [pull_request]
|
3
|
+
jobs:
|
4
|
+
rubocop:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
steps:
|
7
|
+
- uses: actions/checkout@v3
|
8
|
+
- name: Set up Ruby
|
9
|
+
uses: ruby/setup-ruby@v1
|
10
|
+
with:
|
11
|
+
ruby-version: "3.2"
|
12
|
+
bundler-cache: true
|
13
|
+
- name: Run Rubocop
|
14
|
+
run: bundle exec rubocop
|
@@ -0,0 +1,35 @@
|
|
1
|
+
name: Tests
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
strategy:
|
7
|
+
fail-fast: false
|
8
|
+
matrix:
|
9
|
+
entry:
|
10
|
+
- { ruby: "2.7", grape-swagger: "1.6.1" }
|
11
|
+
- { ruby: "3.0", grape-swagger: "1.6.1" }
|
12
|
+
- { ruby: "3.1", grape-swagger: "1.6.1" }
|
13
|
+
- { ruby: "3.2", grape-swagger: "1.6.1" }
|
14
|
+
- { ruby: "3.2", grape-swagger: "2.0.2" }
|
15
|
+
- { ruby: "jruby-9.4.6", grape-swagger: "1.6.1" }
|
16
|
+
- { ruby: "jruby-9.4.6", grape-swagger: "2.0.2" }
|
17
|
+
env:
|
18
|
+
GRAPE_SWAGGER_VERSION: ${{ matrix.entry.grape-swagger }}
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v3
|
21
|
+
- name: Set up Ruby
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.entry.ruby }}
|
25
|
+
bundler-cache: true
|
26
|
+
- name: Setup Firefox
|
27
|
+
uses: browser-actions/setup-firefox@v1
|
28
|
+
with:
|
29
|
+
firefox-version: "111.0.1"
|
30
|
+
- uses: browser-actions/setup-geckodriver@latest
|
31
|
+
with:
|
32
|
+
geckodriver-version: "0.32.2"
|
33
|
+
- uses: coactions/setup-xvfb@v1
|
34
|
+
with:
|
35
|
+
run: bundle exec rake spec
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,61 +1,132 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2024-04-06 14:14:58 UTC using RuboCop version 1.62.1.
|
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
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
+
# Offense count: 6
|
10
|
+
# Configuration parameters: EnforcedStyle.
|
11
|
+
# SupportedStyles: link_or_button, strict
|
12
|
+
Capybara/ClickLinkOrButtonStyle:
|
13
|
+
Exclude:
|
14
|
+
- 'spec/features/swagger_spec.rb'
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
Capybara/SpecificMatcher:
|
18
|
+
Exclude:
|
19
|
+
- 'spec/features/welcome_spec.rb'
|
20
|
+
|
21
|
+
# Offense count: 1
|
22
|
+
# Configuration parameters: Severity, Include.
|
23
|
+
# Include: **/*.gemspec
|
24
|
+
Gemspec/RequiredRubyVersion:
|
25
|
+
Exclude:
|
26
|
+
- 'grape-swagger-rails.gemspec'
|
27
|
+
|
28
|
+
# Offense count: 2
|
29
|
+
# Configuration parameters: AllowedMethods.
|
30
|
+
# AllowedMethods: enums
|
31
|
+
Lint/ConstantDefinitionInBlock:
|
32
|
+
Exclude:
|
33
|
+
- 'lib/tasks/swagger_ui.rake'
|
34
|
+
|
9
35
|
# Offense count: 1
|
10
|
-
Lint/
|
36
|
+
Lint/MixedRegexpCaptureTypes:
|
11
37
|
Exclude:
|
12
38
|
- 'lib/tasks/swagger_ui.rake'
|
13
39
|
|
40
|
+
# Offense count: 4
|
41
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
42
|
+
# AllowedMethods: refine
|
43
|
+
Metrics/BlockLength:
|
44
|
+
Max: 89
|
45
|
+
|
46
|
+
# Offense count: 2
|
47
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
48
|
+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
|
49
|
+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
50
|
+
Naming/FileName:
|
51
|
+
Exclude:
|
52
|
+
- 'lib/grape-swagger-rails.rb'
|
53
|
+
- 'spec/features/grape-swagger-rails_spec.rb'
|
54
|
+
|
55
|
+
# Offense count: 13
|
56
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
57
|
+
# Prefixes: when, with, without
|
58
|
+
RSpec/ContextWording:
|
59
|
+
Exclude:
|
60
|
+
- 'spec/features/swagger_spec.rb'
|
61
|
+
|
14
62
|
# Offense count: 1
|
15
|
-
#
|
16
|
-
|
63
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
64
|
+
# Configuration parameters: SkipBlocks, EnforcedStyle.
|
65
|
+
# SupportedStyles: described_class, explicit
|
66
|
+
RSpec/DescribedClass:
|
17
67
|
Exclude:
|
18
|
-
- 'spec/
|
68
|
+
- 'spec/features/grape-swagger-rails_spec.rb'
|
69
|
+
|
70
|
+
# Offense count: 6
|
71
|
+
# Configuration parameters: CountAsOne.
|
72
|
+
RSpec/ExampleLength:
|
73
|
+
Max: 8
|
74
|
+
|
75
|
+
# Offense count: 1
|
76
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
77
|
+
# Include: **/*_spec*rb*, **/spec/**/*
|
78
|
+
RSpec/FilePath:
|
79
|
+
Exclude:
|
80
|
+
- 'spec/features/grape-swagger-rails_spec.rb'
|
19
81
|
|
20
82
|
# Offense count: 2
|
21
|
-
|
83
|
+
# Configuration parameters: AssignmentOnly.
|
84
|
+
RSpec/InstanceVariable:
|
22
85
|
Exclude:
|
23
|
-
- 'spec/
|
24
|
-
- 'spec/dummy/bin/rake'
|
86
|
+
- 'spec/features/swagger_spec.rb'
|
25
87
|
|
26
|
-
# Offense count:
|
27
|
-
|
28
|
-
|
29
|
-
Max: 129
|
88
|
+
# Offense count: 12
|
89
|
+
RSpec/MultipleExpectations:
|
90
|
+
Max: 4
|
30
91
|
|
31
92
|
# Offense count: 2
|
32
|
-
#
|
33
|
-
#
|
34
|
-
|
35
|
-
|
93
|
+
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
|
94
|
+
# SupportedStyles: always, named_only
|
95
|
+
RSpec/NamedSubject:
|
96
|
+
Exclude:
|
97
|
+
- 'spec/features/grape-swagger-rails_spec.rb'
|
98
|
+
|
99
|
+
# Offense count: 12
|
100
|
+
# Configuration parameters: AllowedGroups.
|
101
|
+
RSpec/NestedGroups:
|
102
|
+
Max: 4
|
103
|
+
|
104
|
+
# Offense count: 1
|
105
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
106
|
+
# Include: **/*_spec.rb
|
107
|
+
RSpec/SpecFilePathFormat:
|
108
|
+
Exclude:
|
109
|
+
- '**/spec/routing/**/*'
|
110
|
+
- 'spec/features/grape-swagger-rails_spec.rb'
|
36
111
|
|
37
|
-
# Offense count:
|
112
|
+
# Offense count: 4
|
113
|
+
# Configuration parameters: AllowedConstants.
|
38
114
|
Style/Documentation:
|
39
115
|
Exclude:
|
116
|
+
- 'spec/**/*'
|
117
|
+
- 'test/**/*'
|
40
118
|
- 'app/controllers/grape_swagger_rails/application_controller.rb'
|
41
119
|
- 'lib/grape-swagger-rails.rb'
|
42
120
|
- 'lib/grape-swagger-rails/engine.rb'
|
43
|
-
- 'lib/grape-swagger-rails/version.rb'
|
44
|
-
- 'spec/dummy/app/api/api.rb'
|
45
|
-
- 'spec/dummy/app/controllers/application_controller.rb'
|
46
|
-
- 'spec/dummy/app/controllers/welcome_controller.rb'
|
47
|
-
- 'spec/dummy/config/application.rb'
|
48
121
|
|
49
|
-
# Offense count:
|
50
|
-
|
51
|
-
Style/FileName:
|
122
|
+
# Offense count: 1
|
123
|
+
Style/OpenStructUse:
|
52
124
|
Exclude:
|
53
125
|
- 'lib/grape-swagger-rails.rb'
|
54
|
-
- 'spec/features/grape-swagger-rails_spec.rb'
|
55
126
|
|
56
|
-
# Offense count:
|
57
|
-
#
|
58
|
-
# Configuration parameters:
|
59
|
-
|
60
|
-
|
61
|
-
|
127
|
+
# Offense count: 2
|
128
|
+
# This cop supports safe autocorrection (--autocorrect).
|
129
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
130
|
+
# URISchemes: http, https
|
131
|
+
Layout/LineLength:
|
132
|
+
Max: 143
|
data/CHANGELOG.md
CHANGED
@@ -1,30 +1,41 @@
|
|
1
|
-
###
|
1
|
+
### 0.5.0 (2024/04/06)
|
2
2
|
|
3
|
-
*
|
3
|
+
* [#110](https://github.com/ruby-grape/grape-swagger-rails/pull/110): Update dummy app to current rails conventions - [@duffn](https://github.com/duffn).
|
4
|
+
* [#112](https://github.com/ruby-grape/grape-swagger-rails/pull/112): Add RuboCop GHA & autocorrect violations - [@duffn](https://github.com/duffn).
|
5
|
+
* [#114](https://github.com/ruby-grape/grape-swagger-rails/pull/114): Add `api_key_placeholder` option - [@SofiaSousa](https://github.com/SofiaSousa).
|
6
|
+
* [#116](https://github.com/ruby-grape/grape-swagger-rails/pull/116): Ensure that `ostruct` is loaded - [@jrmhaig](https://github.com/jrmhaig).
|
7
|
+
* [#117](https://github.com/ruby-grape/grape-swagger-rails/pull/117): Fix rubygems source code location metadata - [@dblock](https://github.com/dblock).
|
8
|
+
* [#118](https://github.com/ruby-grape/grape-swagger-rails/pull/118): Split the test matrix, fix JRuby tests - [@dblock](https://github.com/dblock).
|
4
9
|
|
5
|
-
### 0.
|
10
|
+
### 0.4.0 (2023/03/28)
|
11
|
+
|
12
|
+
* [#107](https://github.com/ruby-grape/grape-swagger-rails/pull/107): Add test matrix for multiple ruby versions - [@duffn](https://github.com/duffn).
|
13
|
+
* [#105](https://github.com/ruby-grape/grape-swagger-rails/pull/105): Migrate to GitHub Actions - [@duffn](https://github.com/duffn).
|
14
|
+
* [#98](https://github.com/ruby-grape/grape-swagger-rails/pull/98): Fix: test against Rails 6 - [@dblock](https://github.com/dblock).
|
15
|
+
|
16
|
+
### 0.3.1 (2019/02/16)
|
6
17
|
|
7
18
|
* [#82](https://github.com/ruby-grape/grape-swagger-rails/pull/82): Fixed api_key_default_value - [@konto-andrzeja](https://github.com/konto-andrzeja).
|
8
19
|
* [#84](https://github.com/ruby-grape/grape-swagger-rails/pull/84): Added the token api_auth type - [@Jack12816](https://github.com/Jack12816).
|
9
20
|
|
10
|
-
### 0.3.0 (
|
21
|
+
### 0.3.0 (2016/09/22)
|
11
22
|
|
12
23
|
* [#70](https://github.com/ruby-grape/grape-swagger-rails/pull/70): Rails 5 support - [@serggl](https://github.com/serggl).
|
13
24
|
* [#68](https://github.com/ruby-grape/grape-swagger-rails/pull/68): Added danger, PR linter - [@dblock](https://github.com/dblock).
|
14
25
|
|
15
|
-
### 0.2.2 (
|
26
|
+
### 0.2.2 (2016/07/13)
|
16
27
|
|
17
28
|
* [#57](https://github.com/ruby-grape/grape-swagger-rails/pull/57): Support Swagger-UI supportedSubmitMethods option - [@ShadowWrathOogles](https://github.com/ShadowWrathOogles).
|
18
29
|
* [#61](https://github.com/ruby-grape/grape-swagger-rails/pull/61): Removed grape and grape-swagger from required dependencies - [@aschuster3](https://github.com/aschuster3).
|
19
30
|
|
20
|
-
### 0.2.1 (
|
31
|
+
### 0.2.1 (2016/05/21)
|
21
32
|
|
22
33
|
* Fixed header-based authorization - [@davidbrewer](https://github.com/davidbrewer).
|
23
34
|
* Support Swagger-UI validatorUrl option - [@davidbrewer](https://github.com/davidbrewer).
|
24
35
|
* Support for grape 0.14.x through 0.16.x and grape-swagger 0.11.x through 0.20.x - [@dblock](https://github.com/dblock).
|
25
36
|
* [#55](https://github.com/ruby-grape/grape-swagger-rails/pull/55): Update Swagger-UI assets and add ability to hide input boxes - [@aschuster3](https://github.com/aschuster3).
|
26
37
|
|
27
|
-
### 0.2.0 (
|
38
|
+
### 0.2.0 (2016/02/23)
|
28
39
|
|
29
40
|
* [#6](https://github.com/ruby-grape/grape-swagger-rails/pull/6): Fix: support multiple predefined headers - [@Tyr0](https://github.com/tyr0).
|
30
41
|
* Upgraded swagger-ui to v2.1.1 - [@dblock](https://github.com/dblock).
|
@@ -35,11 +46,11 @@
|
|
35
46
|
* [#39](https://github.com/ruby-grape/grape-swagger-rails/pull/39): Support CSS media queries - [@alexagranov](https://github.com/alexagranov).
|
36
47
|
* [#42](https://github.com/ruby-grape/grape-swagger-rails/pull/42): Headers added on swaggerUi initialization (before swaggerUi.load() call) - [@sedx](https://github.com/sedx).
|
37
48
|
|
38
|
-
### 0.1.0 (
|
49
|
+
### 0.1.0 (2015/02/05)
|
39
50
|
|
40
51
|
* [#41](https://github.com/BrandyMint/grape-swagger-rails/pull/41): Compatibility with grape-swagger 0.8.0 and 0.9.0 - [@dblock](https://github.com/dblock).
|
41
52
|
|
42
|
-
### 0.0.10 (
|
53
|
+
### 0.0.10 (2014/09/30)
|
43
54
|
|
44
55
|
* [#33](https://github.com/BrandyMint/grape-swagger-rails/pull/33): Fix: make the dummy app runnable - [@dblock](https://github.com/dblock).
|
45
56
|
* [#33](https://github.com/BrandyMint/grape-swagger-rails/pull/33): Fix: headers default to nil - [@dblock](https://github.com/dblock).
|
@@ -51,24 +62,24 @@
|
|
51
62
|
* [#14](https://github.com/BrandyMint/grape-swagger-rails/pull/14): Added app_name to configure title of the app - [@ghilead](https://github.com/ghilead).
|
52
63
|
* [#12](https://github.com/BrandyMint/grape-swagger-rails/pull/12): Fix: SwaggerUI url is combined with appUrl - [@ghilead](https://github.com/ghilead).
|
53
64
|
|
54
|
-
### 0.0.8 (
|
65
|
+
### 0.0.8 (2014/02/06)
|
55
66
|
|
56
67
|
* [#11](https://github.com/BrandyMint/grape-swagger-rails/pull/11): Fixed image loading - [@bitboxer](https://github.com/bitboxer).
|
57
68
|
|
58
|
-
### 0.0.7 (
|
69
|
+
### 0.0.7 (2014/02/05)
|
59
70
|
|
60
71
|
* [#7](https://github.com/BrandyMint/grape-swagger-rails/pull/7): Updated to Swagger-UI 2.0.3 - [@joelvh](https://github.com/joelvh).
|
61
72
|
* [#6](https://github.com/BrandyMint/grape-swagger-rails/pull/6): Added appName and appUrl configuration options - [@swistaczek](https://github.com/swistaczek).
|
62
73
|
|
63
|
-
### 0.0.4 (
|
74
|
+
### 0.0.4 (2013/07/16)
|
64
75
|
|
65
76
|
* Configure discoveryUrl from Rails - [@dapi](https://github.com/dapi).
|
66
77
|
* Added default support for all HTTP methods - [@mtavaresOS](https://github.com/mtavaresOS).
|
67
78
|
|
68
|
-
### 0.0.3 (
|
79
|
+
### 0.0.3 (2013/05/24)
|
69
80
|
|
70
81
|
* Converted to Rails Engine - [@unloved](https://github.com/unloved).
|
71
82
|
|
72
|
-
### 0.0.1 (
|
83
|
+
### 0.0.1 (2013/04/05)
|
73
84
|
|
74
85
|
* Initial public release - [@radanisk](https://github.com/Radanisk).
|
data/Dangerfile
CHANGED
data/Gemfile
CHANGED
@@ -1,26 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
gemspec
|
4
6
|
|
5
|
-
case version = ENV['GRAPE_SWAGGER_VERSION'] || '~>
|
7
|
+
case version = ENV['GRAPE_SWAGGER_VERSION'] || '~> 1.6.0'
|
6
8
|
when 'HEAD'
|
7
|
-
gem 'grape-swagger', github: '
|
8
|
-
when '0.8.0'
|
9
|
-
gem 'grape', '0.9.0'
|
10
|
-
gem 'grape-swagger', '0.8.0'
|
11
|
-
when '0.9.0'
|
12
|
-
gem 'grape', '0.10.1'
|
13
|
-
gem 'grape-swagger', '0.9.0'
|
14
|
-
when '0.11.0'
|
15
|
-
gem 'grape', '0.16.2'
|
16
|
-
gem 'grape-swagger', '0.11.0'
|
17
|
-
when '0.20.2'
|
18
|
-
gem 'grape', '0.14.0'
|
19
|
-
gem 'grape-swagger', '0.20.2'
|
9
|
+
gem 'grape-swagger', github: 'ruby-grape/grape-swagger'
|
20
10
|
else
|
11
|
+
gem 'grape', '>= 1.3.0'
|
21
12
|
gem 'grape-swagger', version
|
22
13
|
end
|
23
14
|
|
24
|
-
group :test do
|
25
|
-
gem '
|
15
|
+
group :development, :test do
|
16
|
+
gem 'capybara'
|
17
|
+
gem 'grape-swagger-ui'
|
18
|
+
gem 'jquery-rails'
|
19
|
+
gem 'mime-types'
|
20
|
+
gem 'nokogiri'
|
21
|
+
gem 'rack', '< 3.0'
|
22
|
+
gem 'rack-cors'
|
23
|
+
gem 'rake'
|
24
|
+
gem 'rspec-rails'
|
25
|
+
gem 'rubocop'
|
26
|
+
gem 'rubocop-capybara'
|
27
|
+
gem 'rubocop-rake'
|
28
|
+
gem 'rubocop-rspec'
|
29
|
+
gem 'ruby-grape-danger', '~> 0.2.0', require: false
|
30
|
+
gem 'selenium-webdriver'
|
31
|
+
gem 'sprockets-rails', require: 'sprockets/railtie'
|
32
|
+
gem 'uglifier'
|
33
|
+
gem 'webrick'
|
26
34
|
end
|
data/README.md
CHANGED
@@ -1,11 +1,29 @@
|
|
1
1
|
# GrapeSwaggerRails
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/grape-swagger-rails)
|
4
|
-
[](https://github.com/ruby-grape/grape-swagger-rails/actions)
|
5
5
|
[](https://codeclimate.com/github/ruby-grape/grape-swagger-rails)
|
6
6
|
|
7
7
|
Swagger UI as Rails Engine for grape-swagger gem.
|
8
8
|
|
9
|
+
# Table of Contents
|
10
|
+
|
11
|
+
- [Installation](#installation)
|
12
|
+
- [Compatibility](#compatibility)
|
13
|
+
- [Usage](#usage)
|
14
|
+
- [Basic Authentication](#basic-authentication)
|
15
|
+
- [Pre-fill Authentication](#pre-fill-authentication)
|
16
|
+
- [API Token Authentication](#api-token-authentication)
|
17
|
+
- [Swagger UI Authorization](#swagger-ui-authorization)
|
18
|
+
- [Integration with DoorKeeper](#integration-with-doorkeeper)
|
19
|
+
- [Hiding the API or Authorization text boxes](#hiding-the-api-or-authorization-text-boxes)
|
20
|
+
- [Updating Swagger UI from Dist](#updating-swagger-ui-from-dist)
|
21
|
+
- [Enabling in a Rails-API Project](#enabling-in-a-rails-api-project)
|
22
|
+
- [Enabling in Rails 6 (Sprokets 5)](#enabling-in-rails-6-sprokets-5)
|
23
|
+
- [Contributors](#contributors)
|
24
|
+
- [Contributing](#contributing)
|
25
|
+
- [License](#license)
|
26
|
+
|
9
27
|
## Installation
|
10
28
|
|
11
29
|
Add this line to your application's Gemfile:
|
@@ -140,9 +158,10 @@ by specify:
|
|
140
158
|
GrapeSwaggerRails.options.api_auth = 'token'
|
141
159
|
GrapeSwaggerRails.options.api_key_name = 'Authorization'
|
142
160
|
GrapeSwaggerRails.options.api_key_type = 'header'
|
161
|
+
GrapeSwaggerRails.options.api_key_placeholder = 'authorization_token'
|
143
162
|
```
|
144
163
|
|
145
|
-
You can use the ```
|
164
|
+
You can use the ```authorization_token``` input box to fill in your API token.
|
146
165
|
### Swagger UI Authorization
|
147
166
|
|
148
167
|
You may want to authenticate users before displaying the Swagger UI, particularly when the API is protected by Basic Authentication.
|
@@ -221,6 +240,17 @@ Include CSS stylesheets in `app/assets/stylesheets/application.css`.
|
|
221
240
|
*/
|
222
241
|
```
|
223
242
|
|
243
|
+
### Enabling in Rails 6 (Sprokets 5)
|
244
|
+
|
245
|
+
Rails 6 top-level targets are determined via `./app/assets/config/manifest.js`. Specify `grape-swagger-rails` asset files as follows.
|
246
|
+
|
247
|
+
```javascript
|
248
|
+
//= link grape_swagger_rails/application.css
|
249
|
+
//= link grape_swagger_rails/application.js
|
250
|
+
```
|
251
|
+
|
252
|
+
See [Upgrading Sprokets](https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs) for more information.
|
253
|
+
|
224
254
|
## Contributors
|
225
255
|
|
226
256
|
* [unloved](https://github.com/unloved)
|
data/RELEASING.md
CHANGED
@@ -11,12 +11,12 @@ bundle install
|
|
11
11
|
rake
|
12
12
|
```
|
13
13
|
|
14
|
-
Check that the last build succeeded in [
|
14
|
+
Check that the last build succeeded in [GitHub Actions](https://github.com/ruby-grape/grape-swagger-rails/actions) for all supported platforms.
|
15
15
|
|
16
16
|
Increment the version, modify [lib/grape-swagger-rails/version.rb](lib/grape-swagger-rails/version.rb).
|
17
17
|
|
18
|
-
*
|
19
|
-
*
|
18
|
+
* Increment the third number if the release has bug fixes and/or very minor features, only (eg. change `0.1.0` to `0.1.1`).
|
19
|
+
* Increment the second number if the release contains major features or breaking API changes (eg. change `0.1.0` to `0.2.0`).
|
20
20
|
|
21
21
|
Change "Next Release" in [CHANGELOG.md](CHANGELOG.md) to the new version.
|
22
22
|
|
@@ -50,8 +50,7 @@ Pushed grape-swagger-rails 0.1.1 to rubygems.org.
|
|
50
50
|
Add the next release to [CHANGELOG.md](CHANGELOG.md).
|
51
51
|
|
52
52
|
```
|
53
|
-
Next Release
|
54
|
-
============
|
53
|
+
### Next Release
|
55
54
|
|
56
55
|
* Your contribution here.
|
57
56
|
```
|
data/Rakefile
CHANGED
@@ -1,14 +1,10 @@
|
|
1
|
-
|
2
|
-
begin
|
3
|
-
require 'bundler/setup'
|
4
|
-
rescue LoadError
|
5
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
-
end
|
1
|
+
# frozen_string_literal: true
|
7
2
|
|
8
|
-
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'bundler/gem_tasks'
|
9
5
|
|
6
|
+
APP_RAKEFILE = File.expand_path('spec/dummy/Rakefile', __dir__)
|
10
7
|
load 'rails/tasks/engine.rake'
|
11
|
-
Bundler::GemHelper.install_tasks
|
12
8
|
|
13
9
|
Dir[File.join(File.dirname(__FILE__), 'lib/tasks/**/*.rake')].each do |f|
|
14
10
|
load f
|
@@ -23,4 +19,4 @@ RSpec::Core::RakeTask.new(:spec)
|
|
23
19
|
require 'rubocop/rake_task'
|
24
20
|
RuboCop::RakeTask.new(:rubocop)
|
25
21
|
|
26
|
-
task default: [
|
22
|
+
task default: %i[rubocop spec]
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module GrapeSwaggerRails
|
2
4
|
class ApplicationController < ActionController::Base
|
3
5
|
if Rails::VERSION::MAJOR >= 4
|
@@ -6,13 +8,13 @@ module GrapeSwaggerRails
|
|
6
8
|
before_filter { run_before_action }
|
7
9
|
end
|
8
10
|
|
9
|
-
def index
|
10
|
-
end
|
11
|
+
def index; end
|
11
12
|
|
12
13
|
private
|
13
14
|
|
14
15
|
def run_before_action
|
15
16
|
return unless GrapeSwaggerRails.options.before_action
|
17
|
+
|
16
18
|
instance_exec(request, &GrapeSwaggerRails.options.before_action)
|
17
19
|
end
|
18
20
|
end
|
@@ -96,7 +96,7 @@
|
|
96
96
|
|
97
97
|
<form id='api_selector'>
|
98
98
|
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
|
99
|
-
<div class='input'><input placeholder="
|
99
|
+
<div class='input'><input placeholder="<%= GrapeSwaggerRails.options.api_key_placeholder %>" id="input_apiKey" name="apiKey" type="text" value="<%= GrapeSwaggerRails.options.api_key_default_value %>"/></div>
|
100
100
|
<div class='input'><a id="explore" class="exploreBtn" href="#">Explore</a></div>
|
101
101
|
</form>
|
102
102
|
</div>
|
data/config/routes.rb
CHANGED
data/grape-swagger-rails.gemspec
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'grape-swagger-rails/version'
|
5
6
|
|
@@ -8,34 +9,17 @@ Gem::Specification.new do |spec|
|
|
8
9
|
spec.version = GrapeSwaggerRails::VERSION
|
9
10
|
spec.authors = ['Alexander Logunov']
|
10
11
|
spec.email = ['unlovedru@gmail.com']
|
11
|
-
spec.description = 'Swagger UI as Rails Engine for grape-swagger gem'
|
12
|
-
spec.summary = 'Swagger UI as Rails Engine for grape-swagger gem'
|
12
|
+
spec.description = 'Swagger UI as Rails Engine for grape-swagger gem.'
|
13
|
+
spec.summary = 'Swagger UI as Rails Engine for grape-swagger gem.'
|
13
14
|
spec.homepage = 'https://github.com/ruby-grape/grape-swagger-rails'
|
14
15
|
spec.license = 'MIT'
|
15
16
|
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
16
|
-
spec.
|
17
|
-
spec.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
spec.add_development_dependency 'rspec-rails'
|
25
|
-
spec.add_development_dependency 'capybara'
|
26
|
-
spec.add_development_dependency 'grape'
|
27
|
-
spec.add_development_dependency 'grape-swagger', '>= 0.7.2'
|
28
|
-
spec.add_development_dependency 'selenium-webdriver'
|
29
|
-
spec.add_development_dependency 'sass-rails'
|
30
|
-
spec.add_development_dependency 'uglifier'
|
31
|
-
spec.add_development_dependency 'coffee-rails'
|
32
|
-
spec.add_development_dependency 'jquery-rails'
|
33
|
-
spec.add_development_dependency 'grape-swagger-ui'
|
34
|
-
spec.add_development_dependency 'sprockets'
|
35
|
-
spec.add_development_dependency 'rack', '~> 1.6'
|
36
|
-
spec.add_development_dependency 'rack-cors'
|
37
|
-
spec.add_development_dependency 'rubocop', '0.38.0'
|
38
|
-
spec.add_development_dependency 'mime-types', '< 3.0'
|
39
|
-
spec.add_development_dependency 'rack-no_animations'
|
40
|
-
spec.add_development_dependency 'nokogiri', '< 1.7.0'
|
17
|
+
spec.require_paths = %w[lib]
|
18
|
+
spec.add_dependency 'railties', '>= 6.0.6.1'
|
19
|
+
spec.metadata = {
|
20
|
+
'bug_tracker_uri' => 'https://github.com/ruby-grape/grape-swagger-rails/issues',
|
21
|
+
'changelog_uri' => 'https://github.com/ruby-grape/grape-swagger-rails/blob/master/CHANGELOG.md',
|
22
|
+
'source_code_uri' => "https://github.com/ruby-grape/grape-swagger-rails/tree/v#{GrapeSwaggerRails::VERSION}",
|
23
|
+
'rubygems_mfa_required' => 'true'
|
24
|
+
}
|
41
25
|
end
|