ropen_pi 0.2.0 → 0.3.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/Gemfile.lock +65 -61
- data/examples/Gemfile +1 -1
- data/examples/Gemfile.lock +2 -2
- data/lib/ropen_pi/specs/example_group_helpers.rb +5 -2
- data/lib/ropen_pi/specs/request_factory.rb +1 -1
- data/lib/ropen_pi/specs/writer.rb +1 -6
- data/lib/ropen_pi/version.rb +1 -1
- data/ropen_pi.gemspec +2 -1
- metadata +21 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f86834742cd1643f964b60f07ce4ae9aa1be0b5187856bf412aed237d3947702
|
|
4
|
+
data.tar.gz: e66857f8eecd559392e4a81e4cdbb044e3f1012f28601c863496dbf0c32a1da3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c3cbd9fc614f7f0791f4fdb0d0965426c2e06ac62cef288ff1ac2307188d73d7f1360cc8852c93bd1aaed81528be18da6cfffb05c9cf51b7435208a626dd30be
|
|
7
|
+
data.tar.gz: a4cb8aebd774ef451f2902d680d53972a2daac7416002e1dfa7a67610c08da6d11556bea23e5945570d90d2968dcc37bec8af3e3b009bfa36aa9e756ec5b1973
|
data/Gemfile.lock
CHANGED
|
@@ -1,72 +1,75 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ropen_pi (0.
|
|
4
|
+
ropen_pi (0.3.0)
|
|
5
5
|
hashie
|
|
6
6
|
json-schema
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
actioncable (6.0.
|
|
12
|
-
actionpack (= 6.0.
|
|
11
|
+
actioncable (6.0.3.1)
|
|
12
|
+
actionpack (= 6.0.3.1)
|
|
13
13
|
nio4r (~> 2.0)
|
|
14
14
|
websocket-driver (>= 0.6.1)
|
|
15
|
-
actionmailbox (6.0.
|
|
16
|
-
actionpack (= 6.0.
|
|
17
|
-
activejob (= 6.0.
|
|
18
|
-
activerecord (= 6.0.
|
|
19
|
-
activestorage (= 6.0.
|
|
20
|
-
activesupport (= 6.0.
|
|
15
|
+
actionmailbox (6.0.3.1)
|
|
16
|
+
actionpack (= 6.0.3.1)
|
|
17
|
+
activejob (= 6.0.3.1)
|
|
18
|
+
activerecord (= 6.0.3.1)
|
|
19
|
+
activestorage (= 6.0.3.1)
|
|
20
|
+
activesupport (= 6.0.3.1)
|
|
21
21
|
mail (>= 2.7.1)
|
|
22
|
-
actionmailer (6.0.
|
|
23
|
-
actionpack (= 6.0.
|
|
24
|
-
actionview (= 6.0.
|
|
25
|
-
activejob (= 6.0.
|
|
22
|
+
actionmailer (6.0.3.1)
|
|
23
|
+
actionpack (= 6.0.3.1)
|
|
24
|
+
actionview (= 6.0.3.1)
|
|
25
|
+
activejob (= 6.0.3.1)
|
|
26
26
|
mail (~> 2.5, >= 2.5.4)
|
|
27
27
|
rails-dom-testing (~> 2.0)
|
|
28
|
-
actionpack (6.0.
|
|
29
|
-
actionview (= 6.0.
|
|
30
|
-
activesupport (= 6.0.
|
|
28
|
+
actionpack (6.0.3.1)
|
|
29
|
+
actionview (= 6.0.3.1)
|
|
30
|
+
activesupport (= 6.0.3.1)
|
|
31
31
|
rack (~> 2.0, >= 2.0.8)
|
|
32
32
|
rack-test (>= 0.6.3)
|
|
33
33
|
rails-dom-testing (~> 2.0)
|
|
34
34
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
35
|
-
actiontext (6.0.
|
|
36
|
-
actionpack (= 6.0.
|
|
37
|
-
activerecord (= 6.0.
|
|
38
|
-
activestorage (= 6.0.
|
|
39
|
-
activesupport (= 6.0.
|
|
35
|
+
actiontext (6.0.3.1)
|
|
36
|
+
actionpack (= 6.0.3.1)
|
|
37
|
+
activerecord (= 6.0.3.1)
|
|
38
|
+
activestorage (= 6.0.3.1)
|
|
39
|
+
activesupport (= 6.0.3.1)
|
|
40
40
|
nokogiri (>= 1.8.5)
|
|
41
|
-
actionview (6.0.
|
|
42
|
-
activesupport (= 6.0.
|
|
41
|
+
actionview (6.0.3.1)
|
|
42
|
+
activesupport (= 6.0.3.1)
|
|
43
43
|
builder (~> 3.1)
|
|
44
44
|
erubi (~> 1.4)
|
|
45
45
|
rails-dom-testing (~> 2.0)
|
|
46
46
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
47
|
-
activejob (6.0.
|
|
48
|
-
activesupport (= 6.0.
|
|
47
|
+
activejob (6.0.3.1)
|
|
48
|
+
activesupport (= 6.0.3.1)
|
|
49
49
|
globalid (>= 0.3.6)
|
|
50
|
-
activemodel (6.0.
|
|
51
|
-
activesupport (= 6.0.
|
|
52
|
-
activerecord (6.0.
|
|
53
|
-
activemodel (= 6.0.
|
|
54
|
-
activesupport (= 6.0.
|
|
55
|
-
activestorage (6.0.
|
|
56
|
-
actionpack (= 6.0.
|
|
57
|
-
activejob (= 6.0.
|
|
58
|
-
activerecord (= 6.0.
|
|
50
|
+
activemodel (6.0.3.1)
|
|
51
|
+
activesupport (= 6.0.3.1)
|
|
52
|
+
activerecord (6.0.3.1)
|
|
53
|
+
activemodel (= 6.0.3.1)
|
|
54
|
+
activesupport (= 6.0.3.1)
|
|
55
|
+
activestorage (6.0.3.1)
|
|
56
|
+
actionpack (= 6.0.3.1)
|
|
57
|
+
activejob (= 6.0.3.1)
|
|
58
|
+
activerecord (= 6.0.3.1)
|
|
59
59
|
marcel (~> 0.3.1)
|
|
60
|
-
activesupport (6.0.
|
|
60
|
+
activesupport (6.0.3.1)
|
|
61
61
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
62
62
|
i18n (>= 0.7, < 2)
|
|
63
63
|
minitest (~> 5.1)
|
|
64
64
|
tzinfo (~> 1.1)
|
|
65
|
-
zeitwerk (~> 2.2)
|
|
65
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
|
66
66
|
addressable (2.7.0)
|
|
67
67
|
public_suffix (>= 2.0.2, < 5.0)
|
|
68
68
|
builder (3.2.4)
|
|
69
69
|
bump (0.8.0)
|
|
70
|
+
bundler-audit (0.6.1)
|
|
71
|
+
bundler (>= 1.2.0, < 3)
|
|
72
|
+
thor (~> 0.18)
|
|
70
73
|
byebug (11.0.1)
|
|
71
74
|
coderay (1.1.2)
|
|
72
75
|
concurrent-ruby (1.1.6)
|
|
@@ -76,7 +79,7 @@ GEM
|
|
|
76
79
|
globalid (0.4.2)
|
|
77
80
|
activesupport (>= 4.2.0)
|
|
78
81
|
hashie (4.1.0)
|
|
79
|
-
i18n (1.8.
|
|
82
|
+
i18n (1.8.3)
|
|
80
83
|
concurrent-ruby (~> 1.0)
|
|
81
84
|
json-schema (2.8.1)
|
|
82
85
|
addressable (>= 2.4)
|
|
@@ -88,10 +91,10 @@ GEM
|
|
|
88
91
|
marcel (0.3.3)
|
|
89
92
|
mimemagic (~> 0.3.2)
|
|
90
93
|
method_source (0.9.2)
|
|
91
|
-
mimemagic (0.3.
|
|
94
|
+
mimemagic (0.3.5)
|
|
92
95
|
mini_mime (1.0.2)
|
|
93
96
|
mini_portile2 (2.4.0)
|
|
94
|
-
minitest (5.14.
|
|
97
|
+
minitest (5.14.1)
|
|
95
98
|
nio4r (2.5.2)
|
|
96
99
|
nokogiri (1.10.9)
|
|
97
100
|
mini_portile2 (~> 2.4.0)
|
|
@@ -101,33 +104,33 @@ GEM
|
|
|
101
104
|
pry-byebug (3.7.0)
|
|
102
105
|
byebug (~> 11.0)
|
|
103
106
|
pry (~> 0.10)
|
|
104
|
-
public_suffix (4.0.
|
|
107
|
+
public_suffix (4.0.5)
|
|
105
108
|
rack (2.2.2)
|
|
106
109
|
rack-test (1.1.0)
|
|
107
110
|
rack (>= 1.0, < 3)
|
|
108
|
-
rails (6.0.
|
|
109
|
-
actioncable (= 6.0.
|
|
110
|
-
actionmailbox (= 6.0.
|
|
111
|
-
actionmailer (= 6.0.
|
|
112
|
-
actionpack (= 6.0.
|
|
113
|
-
actiontext (= 6.0.
|
|
114
|
-
actionview (= 6.0.
|
|
115
|
-
activejob (= 6.0.
|
|
116
|
-
activemodel (= 6.0.
|
|
117
|
-
activerecord (= 6.0.
|
|
118
|
-
activestorage (= 6.0.
|
|
119
|
-
activesupport (= 6.0.
|
|
111
|
+
rails (6.0.3.1)
|
|
112
|
+
actioncable (= 6.0.3.1)
|
|
113
|
+
actionmailbox (= 6.0.3.1)
|
|
114
|
+
actionmailer (= 6.0.3.1)
|
|
115
|
+
actionpack (= 6.0.3.1)
|
|
116
|
+
actiontext (= 6.0.3.1)
|
|
117
|
+
actionview (= 6.0.3.1)
|
|
118
|
+
activejob (= 6.0.3.1)
|
|
119
|
+
activemodel (= 6.0.3.1)
|
|
120
|
+
activerecord (= 6.0.3.1)
|
|
121
|
+
activestorage (= 6.0.3.1)
|
|
122
|
+
activesupport (= 6.0.3.1)
|
|
120
123
|
bundler (>= 1.3.0)
|
|
121
|
-
railties (= 6.0.
|
|
124
|
+
railties (= 6.0.3.1)
|
|
122
125
|
sprockets-rails (>= 2.0.0)
|
|
123
126
|
rails-dom-testing (2.0.3)
|
|
124
127
|
activesupport (>= 4.2.0)
|
|
125
128
|
nokogiri (>= 1.6)
|
|
126
129
|
rails-html-sanitizer (1.3.0)
|
|
127
130
|
loofah (~> 2.3)
|
|
128
|
-
railties (6.0.
|
|
129
|
-
actionpack (= 6.0.
|
|
130
|
-
activesupport (= 6.0.
|
|
131
|
+
railties (6.0.3.1)
|
|
132
|
+
actionpack (= 6.0.3.1)
|
|
133
|
+
activesupport (= 6.0.3.1)
|
|
131
134
|
method_source
|
|
132
135
|
rake (>= 0.8.7)
|
|
133
136
|
thor (>= 0.20.3, < 2.0)
|
|
@@ -145,20 +148,20 @@ GEM
|
|
|
145
148
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
146
149
|
rspec-support (~> 3.9.0)
|
|
147
150
|
rspec-support (3.9.2)
|
|
148
|
-
sprockets (4.0.
|
|
151
|
+
sprockets (4.0.2)
|
|
149
152
|
concurrent-ruby (~> 1.0)
|
|
150
153
|
rack (> 1, < 3)
|
|
151
154
|
sprockets-rails (3.2.1)
|
|
152
155
|
actionpack (>= 4.0)
|
|
153
156
|
activesupport (>= 4.0)
|
|
154
157
|
sprockets (>= 3.0.0)
|
|
155
|
-
thor (
|
|
158
|
+
thor (0.20.3)
|
|
156
159
|
thread_safe (0.3.6)
|
|
157
160
|
tzinfo (1.2.7)
|
|
158
161
|
thread_safe (~> 0.1)
|
|
159
|
-
websocket-driver (0.7.
|
|
162
|
+
websocket-driver (0.7.2)
|
|
160
163
|
websocket-extensions (>= 0.1.0)
|
|
161
|
-
websocket-extensions (0.1.
|
|
164
|
+
websocket-extensions (0.1.5)
|
|
162
165
|
zeitwerk (2.3.0)
|
|
163
166
|
|
|
164
167
|
PLATFORMS
|
|
@@ -167,8 +170,9 @@ PLATFORMS
|
|
|
167
170
|
DEPENDENCIES
|
|
168
171
|
bump
|
|
169
172
|
bundler (~> 2.0)
|
|
173
|
+
bundler-audit
|
|
170
174
|
pry-byebug
|
|
171
|
-
rails (~> 6.0.
|
|
175
|
+
rails (~> 6.0.3.1)
|
|
172
176
|
rake (~> 13.0)
|
|
173
177
|
ropen_pi!
|
|
174
178
|
rspec (~> 3.9)
|
data/examples/Gemfile
CHANGED
data/examples/Gemfile.lock
CHANGED
|
@@ -117,7 +117,7 @@ GEM
|
|
|
117
117
|
pry-stack_explorer (0.4.9.3)
|
|
118
118
|
binding_of_caller (>= 0.7)
|
|
119
119
|
pry (>= 0.9.11)
|
|
120
|
-
puma (4.3.
|
|
120
|
+
puma (4.3.5)
|
|
121
121
|
nio4r (~> 2.0)
|
|
122
122
|
rack (2.1.1)
|
|
123
123
|
rack-cors (1.1.1)
|
|
@@ -218,7 +218,7 @@ DEPENDENCIES
|
|
|
218
218
|
pry-byebug
|
|
219
219
|
pry-rails
|
|
220
220
|
pry-stack_explorer
|
|
221
|
-
puma (~> 4.3.
|
|
221
|
+
puma (~> 4.3.5)
|
|
222
222
|
rack-cors (>= 1.0.6)
|
|
223
223
|
rails (~> 6.0.0)
|
|
224
224
|
rspec-rails
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
+
|
|
2
3
|
# @TODO: replace hashie!
|
|
3
4
|
require 'hashie'
|
|
4
5
|
|
|
@@ -105,18 +106,19 @@ module RopenPi
|
|
|
105
106
|
# rubocop:enable Metrics/MethodLength
|
|
106
107
|
|
|
107
108
|
def request_body_text_plain(required: false, description: nil, examples: nil)
|
|
108
|
-
content_hash = { 'test/plain' => { schema: {type: :string}, examples: examples }.compact! || {} }
|
|
109
|
+
content_hash = { 'test/plain' => { schema: { type: :string }, examples: examples }.compact! || {} }
|
|
109
110
|
request_body(description: description, required: required, content: content_hash)
|
|
110
111
|
end
|
|
111
112
|
|
|
112
113
|
# TODO: add examples to this like we can for json, might be large lift
|
|
113
114
|
# as many assumptions are made on content-type
|
|
114
115
|
def request_body_xml(schema:, required: false, description: nil, examples: nil)
|
|
115
|
-
passed_examples = Array(examples)
|
|
116
|
+
# passed_examples = Array(examples)
|
|
116
117
|
content_hash = { 'application/xml' => { schema: schema, examples: examples }.compact! || {} }
|
|
117
118
|
request_body(description: description, required: required, content: content_hash)
|
|
118
119
|
end
|
|
119
120
|
|
|
121
|
+
# rubocop:disable Metrics/MethodLength
|
|
120
122
|
def request_body_multipart(schema:, description: nil)
|
|
121
123
|
content_hash = { 'multipart/form-data' => { schema: schema } }
|
|
122
124
|
request_body(description: description, content: content_hash)
|
|
@@ -145,6 +147,7 @@ module RopenPi
|
|
|
145
147
|
end
|
|
146
148
|
end
|
|
147
149
|
end
|
|
150
|
+
# rubocop:enable Metrics/MethodLength
|
|
148
151
|
|
|
149
152
|
def parameter(attributes)
|
|
150
153
|
attributes[:required] = true if attributes[:in] && attributes[:in].to_sym == :path
|
|
@@ -161,7 +161,7 @@ class RopenPi::Specs::RequestFactory
|
|
|
161
161
|
# Rails test infrastructure allows us to send the values directly as a hash
|
|
162
162
|
# PROS: simple to implement, CONS: serialization/deserialization is bypassed in test
|
|
163
163
|
tuples = parameters.select { |p| p[:in] == :formData }
|
|
164
|
-
|
|
164
|
+
.map { |p| [p[:name], example.send(p[:name])] }
|
|
165
165
|
Hash[tuples]
|
|
166
166
|
end
|
|
167
167
|
|
|
@@ -9,13 +9,8 @@ module RopenPi::Specs
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
module Yml
|
|
12
|
-
require 'active_support/core_ext/hash/keys'
|
|
13
|
-
|
|
14
12
|
def self.convert(doc)
|
|
15
|
-
doc.
|
|
16
|
-
doc.deep_transform_values { |value| value.to_s if value.is_a?(Symbol) }
|
|
17
|
-
|
|
18
|
-
doc.to_yaml
|
|
13
|
+
JSON.parse(Json.convert(doc)).to_yaml
|
|
19
14
|
end
|
|
20
15
|
end
|
|
21
16
|
|
data/lib/ropen_pi/version.rb
CHANGED
data/ropen_pi.gemspec
CHANGED
|
@@ -27,7 +27,8 @@ Gem::Specification.new do |spec|
|
|
|
27
27
|
spec.add_development_dependency "rspec", "~> 3.9"
|
|
28
28
|
spec.add_development_dependency "pry-byebug"
|
|
29
29
|
spec.add_development_dependency "bump"
|
|
30
|
-
spec.add_development_dependency "
|
|
30
|
+
spec.add_development_dependency "bundler-audit"
|
|
31
|
+
spec.add_development_dependency "rails", "~> 6.0.3.1"
|
|
31
32
|
|
|
32
33
|
#
|
|
33
34
|
# spec.add_runtime_dependency "dry_open_api", "~> 0.1.1"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ropen_pi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andy Ruck
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-06-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -80,20 +80,34 @@ dependencies:
|
|
|
80
80
|
- - ">="
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: bundler-audit
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
83
97
|
- !ruby/object:Gem::Dependency
|
|
84
98
|
name: rails
|
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
|
86
100
|
requirements:
|
|
87
101
|
- - "~>"
|
|
88
102
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 6.0.
|
|
103
|
+
version: 6.0.3.1
|
|
90
104
|
type: :development
|
|
91
105
|
prerelease: false
|
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
107
|
requirements:
|
|
94
108
|
- - "~>"
|
|
95
109
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 6.0.
|
|
110
|
+
version: 6.0.3.1
|
|
97
111
|
- !ruby/object:Gem::Dependency
|
|
98
112
|
name: hashie
|
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -170,7 +184,7 @@ homepage: https://github.com/talentplatforms/ropen_pi
|
|
|
170
184
|
licenses:
|
|
171
185
|
- MIT
|
|
172
186
|
metadata: {}
|
|
173
|
-
post_install_message:
|
|
187
|
+
post_install_message:
|
|
174
188
|
rdoc_options: []
|
|
175
189
|
require_paths:
|
|
176
190
|
- lib
|
|
@@ -186,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
186
200
|
version: '0'
|
|
187
201
|
requirements: []
|
|
188
202
|
rubygems_version: 3.1.2
|
|
189
|
-
signing_key:
|
|
203
|
+
signing_key:
|
|
190
204
|
specification_version: 4
|
|
191
205
|
summary: Integration of OpenAPI v3 and RSPEC
|
|
192
206
|
test_files: []
|