open_api 0.3.4 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +29 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +8 -0
- data/gemfiles/rails-5.2.gemfile +8 -0
- data/gemfiles/rails-6.0.gemfile +8 -0
- data/lib/open_api/callback.rb +2 -2
- data/lib/open_api/parameter.rb +12 -0
- data/lib/open_api/paths.rb +2 -2
- data/lib/open_api/version.rb +1 -1
- data/open_api.gemspec +5 -4
- metadata +22 -15
- data/.travis.yml +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75dc67d9e9d1cdbffed8875e3a3c77eb0eb18518528c34981dbbe822a2b57907
|
4
|
+
data.tar.gz: b886a58671dda0ed82c0c5d2b7312c6d40b613ba73556dad12e610e1d3f97153
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b2defd6fb6cb5ce3ed1d02283f9cdf8d9b398c0ffc9a4f022e8ff8da82e8880ab6b97ebb66b51e9111eede33d7d13a1f883665865b387e3ceaa2a4e5c4e4ead
|
7
|
+
data.tar.gz: 8d2645eee0608e9cd816cc876d905b6ef04cef1528e098c1cf61ad6fd2bde859db3366281cc76254395d17d3f2e6e5961b2a89a573c2e27d075fe6919d636d88
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: test
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
matrix:
|
7
|
+
ruby: ["2.5", "2.6", "2.7", "3.0"]
|
8
|
+
gemfile: [Gemfile]
|
9
|
+
include:
|
10
|
+
- ruby: "2.7"
|
11
|
+
gemfile: "gemfiles/rails-6.0.gemfile"
|
12
|
+
- ruby: "2.6"
|
13
|
+
gemfile: "gemfiles/rails-5.2.gemfile"
|
14
|
+
|
15
|
+
env:
|
16
|
+
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
17
|
+
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v2
|
21
|
+
- uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
bundler-cache: true
|
25
|
+
- run: bundle exec rake
|
26
|
+
- name: Send coverage
|
27
|
+
uses: paambaati/codeclimate-action@v2.7.5
|
28
|
+
env:
|
29
|
+
CC_TEST_REPORTER_ID: 618e64226e212a5824797037cb1a71487cdbfb3aa664bddc42a7189fb027f73a
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 0.6.1
|
4
|
+
- Fix `Paths` initializer to enable to take no args
|
5
|
+
## 0.6.0
|
6
|
+
- Supported Ruby 3.0 by fixing keyword parameters
|
7
|
+
- Relaxed the version constraint on Rails
|
8
|
+
## 0.5.0
|
9
|
+
- Allow using with rails 6
|
10
|
+
|
3
11
|
## 0.3.4
|
4
12
|
* Fix to use array object for "propaties" of Schema
|
5
13
|
|
data/lib/open_api/callback.rb
CHANGED
@@ -3,7 +3,7 @@ module OpenApi
|
|
3
3
|
class Callback
|
4
4
|
extend Forwardable
|
5
5
|
|
6
|
-
def initialize(
|
6
|
+
def initialize(hash = {})
|
7
7
|
self.hash = hash.with_indifferent_access
|
8
8
|
end
|
9
9
|
|
@@ -12,7 +12,7 @@ module OpenApi
|
|
12
12
|
def self.load(hash)
|
13
13
|
return unless hash
|
14
14
|
|
15
|
-
new(
|
15
|
+
new(hash.symbolize_keys)
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
data/lib/open_api/parameter.rb
CHANGED
@@ -45,6 +45,18 @@ module OpenApi
|
|
45
45
|
)
|
46
46
|
end
|
47
47
|
|
48
|
+
def serializable_hash
|
49
|
+
{
|
50
|
+
"name" => name.to_s,
|
51
|
+
"in" => self.in.to_s,
|
52
|
+
"required" => required,
|
53
|
+
"deprecated" => deprecated,
|
54
|
+
"allow_empty_value" => allow_empty_value,
|
55
|
+
}.merge(
|
56
|
+
other_fields_hash.map{|k,v| [k.to_s, v.serializable_hash] }.to_h
|
57
|
+
).compact
|
58
|
+
end
|
59
|
+
|
48
60
|
private
|
49
61
|
|
50
62
|
attr_accessor :other_fields_hash
|
data/lib/open_api/paths.rb
CHANGED
@@ -4,7 +4,7 @@ module OpenApi
|
|
4
4
|
extend Forwardable
|
5
5
|
prepend EquatableAsContent
|
6
6
|
|
7
|
-
def initialize(
|
7
|
+
def initialize(path_hash = {})
|
8
8
|
self.path_hash = path_hash.with_indifferent_access
|
9
9
|
end
|
10
10
|
|
@@ -12,7 +12,7 @@ module OpenApi
|
|
12
12
|
|
13
13
|
def self.load(hash)
|
14
14
|
hash = hash.map { |k, v| [k.to_sym, PathItem.load(v)] }.to_h
|
15
|
-
new(
|
15
|
+
new(hash)
|
16
16
|
end
|
17
17
|
|
18
18
|
def serializable_hash
|
data/lib/open_api/version.rb
CHANGED
data/open_api.gemspec
CHANGED
@@ -21,11 +21,12 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
spec.add_dependency "activesupport",
|
25
|
-
spec.add_development_dependency "bundler", "~>
|
26
|
-
spec.add_development_dependency "rake", "~>
|
24
|
+
spec.add_dependency "activesupport", ['>= 5.0', '< 6.2']
|
25
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
26
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
27
27
|
spec.add_development_dependency "rspec", "~> 3.0"
|
28
28
|
spec.add_development_dependency "pry"
|
29
|
-
|
29
|
+
# Pin to 1.17 due to https://github.com/codeclimate/test-reporter/issues/413
|
30
|
+
spec.add_development_dependency "simplecov", "~> 0.17.0"
|
30
31
|
spec.add_development_dependency "bump"
|
31
32
|
end
|
metadata
CHANGED
@@ -1,57 +1,63 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kent Nagata
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '5.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '6.2'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '5.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '6.2'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: bundler
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
39
|
+
version: '2.0'
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
46
|
+
version: '2.0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rake
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
53
|
+
version: '13.0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '13.0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: rspec
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,16 +90,16 @@ dependencies:
|
|
84
90
|
name: simplecov
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
86
92
|
requirements:
|
87
|
-
- - "
|
93
|
+
- - "~>"
|
88
94
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
95
|
+
version: 0.17.0
|
90
96
|
type: :development
|
91
97
|
prerelease: false
|
92
98
|
version_requirements: !ruby/object:Gem::Requirement
|
93
99
|
requirements:
|
94
|
-
- - "
|
100
|
+
- - "~>"
|
95
101
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
102
|
+
version: 0.17.0
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
104
|
name: bump
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,10 +122,10 @@ extensions: []
|
|
116
122
|
extra_rdoc_files: []
|
117
123
|
files:
|
118
124
|
- ".github/ISSUE_TEMPLATE/Custom.md"
|
125
|
+
- ".github/workflows/test.yml"
|
119
126
|
- ".gitignore"
|
120
127
|
- ".rspec"
|
121
128
|
- ".ruby-version"
|
122
|
-
- ".travis.yml"
|
123
129
|
- CHANGELOG.md
|
124
130
|
- CODE_OF_CONDUCT.md
|
125
131
|
- Gemfile
|
@@ -128,6 +134,8 @@ files:
|
|
128
134
|
- Rakefile
|
129
135
|
- bin/console
|
130
136
|
- bin/setup
|
137
|
+
- gemfiles/rails-5.2.gemfile
|
138
|
+
- gemfiles/rails-6.0.gemfile
|
131
139
|
- lib/open_api.rb
|
132
140
|
- lib/open_api/callback.rb
|
133
141
|
- lib/open_api/components.rb
|
@@ -184,8 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
192
|
- !ruby/object:Gem::Version
|
185
193
|
version: '0'
|
186
194
|
requirements: []
|
187
|
-
|
188
|
-
rubygems_version: 2.7.3
|
195
|
+
rubygems_version: 3.1.4
|
189
196
|
signing_key:
|
190
197
|
specification_version: 4
|
191
198
|
summary: Provide PORO of OpenAPI specification
|
data/.travis.yml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
env:
|
2
|
-
global:
|
3
|
-
- CC_TEST_REPORTER_ID=618e64226e212a5824797037cb1a71487cdbfb3aa664bddc42a7189fb027f73a
|
4
|
-
sudo: false
|
5
|
-
language: ruby
|
6
|
-
rvm:
|
7
|
-
- 2.4.4
|
8
|
-
- 2.5.1
|
9
|
-
before_install: gem install bundler -v 1.16.1
|
10
|
-
before_script:
|
11
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
12
|
-
- chmod +x ./cc-test-reporter
|
13
|
-
- ./cc-test-reporter before-build
|
14
|
-
after_script:
|
15
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|