swagalicious 0.4.3 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile.lock +36 -35
- data/lib/swagalicious/example_helpers.rb +3 -3
- data/lib/swagalicious/extended_schema.rb +1 -1
- data/lib/swagalicious/request_factory.rb +1 -1
- data/lib/swagalicious/version.rb +1 -1
- data/swagalicious.gemspec +6 -5
- metadata +25 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2039bd3f0c7d96f3b0793d3d2688acae7c450815a8943532187b218f3d7d7939
|
4
|
+
data.tar.gz: 18ee9a8aa325795e4b75f221c70f0ccf7195007872f9c4366db56f98c471905d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21cf90ba1dc63fef0fcf37182fba4ab92938878f2e66442369a880c10624a59f1344a72297b9b94b28cde9e3fddf0dc1874ddef57e17ddc40d365b962547eb9d
|
7
|
+
data.tar.gz: f5c66b99a2cd90e607daa22f93995e37a1019e9b28620c56d2b8348221c94a545a3ac54167e35062e81122b7bfdfadf4bfb43d53863a1d4ae7b578f869963554
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,70 +1,71 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
swagalicious (0.4.
|
5
|
-
faraday (~>
|
6
|
-
|
4
|
+
swagalicious (0.4.5)
|
5
|
+
faraday (~> 2.0)
|
6
|
+
faraday-rack
|
7
|
+
json-schema
|
7
8
|
oj (~> 3.11.0)
|
8
|
-
rspec (~> 3
|
9
|
+
rspec (~> 3)
|
9
10
|
|
10
11
|
GEM
|
11
12
|
remote: https://rubygems.org/
|
12
13
|
specs:
|
13
|
-
activesupport (6.1.
|
14
|
+
activesupport (6.1.6)
|
14
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
16
|
i18n (>= 1.6, < 2)
|
16
17
|
minitest (>= 5.1)
|
17
18
|
tzinfo (~> 2.0)
|
18
19
|
zeitwerk (~> 2.3)
|
19
|
-
addressable (2.
|
20
|
+
addressable (2.8.0)
|
20
21
|
public_suffix (>= 2.0.2, < 5.0)
|
21
22
|
byebug (11.1.3)
|
22
23
|
coderay (1.1.3)
|
23
|
-
concurrent-ruby (1.1.
|
24
|
-
diff-lcs (1.
|
24
|
+
concurrent-ruby (1.1.10)
|
25
|
+
diff-lcs (1.5.0)
|
25
26
|
factory_bot (6.1.0)
|
26
27
|
activesupport (>= 5.0.0)
|
27
|
-
faraday (
|
28
|
-
faraday-net_http (~>
|
29
|
-
|
30
|
-
|
31
|
-
faraday-
|
32
|
-
|
28
|
+
faraday (2.3.0)
|
29
|
+
faraday-net_http (~> 2.0)
|
30
|
+
ruby2_keywords (>= 0.0.4)
|
31
|
+
faraday-net_http (2.0.3)
|
32
|
+
faraday-rack (2.0.0)
|
33
|
+
faraday (~> 2.0)
|
34
|
+
i18n (1.10.0)
|
33
35
|
concurrent-ruby (~> 1.0)
|
34
|
-
json-schema (
|
35
|
-
addressable (>= 2.
|
36
|
+
json-schema (3.0.0)
|
37
|
+
addressable (>= 2.8)
|
36
38
|
method_source (1.0.0)
|
37
|
-
minitest (5.
|
38
|
-
|
39
|
-
oj (3.11.3)
|
39
|
+
minitest (5.16.1)
|
40
|
+
oj (3.11.8)
|
40
41
|
pry (0.13.1)
|
41
42
|
coderay (~> 1.1)
|
42
43
|
method_source (~> 1.0)
|
43
44
|
pry-byebug (3.9.0)
|
44
45
|
byebug (~> 11.0)
|
45
46
|
pry (~> 0.13.0)
|
46
|
-
public_suffix (4.0.
|
47
|
-
rack (2.2.3)
|
47
|
+
public_suffix (4.0.7)
|
48
|
+
rack (2.2.3.1)
|
48
49
|
rack-test (1.1.0)
|
49
50
|
rack (>= 1.0, < 3)
|
50
51
|
rake (12.3.3)
|
51
|
-
rspec (3.
|
52
|
-
rspec-core (~> 3.
|
53
|
-
rspec-expectations (~> 3.
|
54
|
-
rspec-mocks (~> 3.
|
55
|
-
rspec-core (3.
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-expectations (3.
|
52
|
+
rspec (3.11.0)
|
53
|
+
rspec-core (~> 3.11.0)
|
54
|
+
rspec-expectations (~> 3.11.0)
|
55
|
+
rspec-mocks (~> 3.11.0)
|
56
|
+
rspec-core (3.11.0)
|
57
|
+
rspec-support (~> 3.11.0)
|
58
|
+
rspec-expectations (3.11.0)
|
58
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-mocks (3.
|
60
|
+
rspec-support (~> 3.11.0)
|
61
|
+
rspec-mocks (3.11.1)
|
61
62
|
diff-lcs (>= 1.2.0, < 2.0)
|
62
|
-
rspec-support (~> 3.
|
63
|
-
rspec-support (3.
|
64
|
-
ruby2_keywords (0.0.
|
63
|
+
rspec-support (~> 3.11.0)
|
64
|
+
rspec-support (3.11.0)
|
65
|
+
ruby2_keywords (0.0.5)
|
65
66
|
tzinfo (2.0.4)
|
66
67
|
concurrent-ruby (~> 1.0)
|
67
|
-
zeitwerk (2.
|
68
|
+
zeitwerk (2.6.0)
|
68
69
|
|
69
70
|
PLATFORMS
|
70
71
|
ruby
|
@@ -78,4 +79,4 @@ DEPENDENCIES
|
|
78
79
|
swagalicious!
|
79
80
|
|
80
81
|
BUNDLED WITH
|
81
|
-
2.2.
|
82
|
+
2.2.31
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require "faraday"
|
2
|
-
require "faraday/
|
2
|
+
require "faraday/rack"
|
3
3
|
require "rack"
|
4
4
|
require "oj"
|
5
5
|
|
@@ -25,7 +25,7 @@ class Swagalicious
|
|
25
25
|
|
26
26
|
def client
|
27
27
|
@client ||= Faraday.new do |b|
|
28
|
-
b.adapter
|
28
|
+
b.adapter(:rack)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -68,7 +68,7 @@ class Swagalicious
|
|
68
68
|
metadata[:response][:requestBody][:content][mime_type][:examples][full_title][:value] = Oj.load(request[:payload]).dup
|
69
69
|
end
|
70
70
|
|
71
|
-
metadata[:response][:examples][mime_type]
|
71
|
+
metadata[:response][:examples][mime_type] ||= {}
|
72
72
|
metadata[:response][:examples][mime_type][full_title] = @body
|
73
73
|
end
|
74
74
|
|
@@ -12,7 +12,7 @@ class Swagalicious
|
|
12
12
|
|
13
13
|
class ExtendedTypeAttribute < JSON::Schema::TypeV4Attribute
|
14
14
|
def self.validate(current_schema, data, fragments, processor, validator, options={})
|
15
|
-
return if data.nil? && current_schema.schema["null"] == true
|
15
|
+
return if data.nil? && (current_schema.schema["null"] == true || current_schema.schema["nullable"] == true)
|
16
16
|
super
|
17
17
|
end
|
18
18
|
end
|
@@ -86,7 +86,7 @@ class Swagalicious
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def add_path(request, metadata, swagger_doc, parameters, example)
|
89
|
-
template = (swagger_doc[:basePath] || "") + metadata[:path_item][:template]
|
89
|
+
template = (swagger_doc[:basePath] || (swagger_doc[:servers]&.first || {})[:url] || "") + metadata[:path_item][:template]
|
90
90
|
|
91
91
|
request[:path] = template.tap do |path_template|
|
92
92
|
parameters.select { |p| p[:in] == :path }.each do |p|
|
data/lib/swagalicious/version.rb
CHANGED
data/swagalicious.gemspec
CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = "swagalicious"
|
5
5
|
spec.version = Swagalicious::VERSION
|
6
6
|
spec.authors = ["Eugene Howe"]
|
7
|
-
spec.email = ["eugene@
|
7
|
+
spec.email = ["eugene.howe@protonmail.com"]
|
8
8
|
|
9
9
|
spec.summary = %q{RSwag without Rails}
|
10
10
|
spec.description = %q{This gem is almost a straight copy and paste of https://github.com/rswag/rswag/tree/master/rswag-specs with the Rails specific code stripped out so it can be used in Rack applications that don't use Rails.}
|
@@ -24,10 +24,11 @@ Gem::Specification.new do |spec|
|
|
24
24
|
end
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
|
-
spec.add_dependency "faraday",
|
28
|
-
spec.add_dependency "
|
29
|
-
spec.add_dependency "
|
30
|
-
spec.add_dependency "
|
27
|
+
spec.add_dependency "faraday", "~> 2.0"
|
28
|
+
spec.add_dependency "faraday-rack"
|
29
|
+
spec.add_dependency "json-schema"
|
30
|
+
spec.add_dependency "oj", "~> 3.11.0"
|
31
|
+
spec.add_dependency "rspec", "~> 3"
|
31
32
|
|
32
33
|
spec.add_development_dependency "factory_bot", "~> 6.1.0"
|
33
34
|
spec.add_development_dependency "pry-byebug", "~> 3.9.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagalicious
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Howe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,28 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday-rack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: json-schema
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- - "
|
45
|
+
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
47
|
+
version: '0'
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- - "
|
52
|
+
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: oj
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +72,14 @@ dependencies:
|
|
58
72
|
requirements:
|
59
73
|
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3
|
75
|
+
version: '3'
|
62
76
|
type: :runtime
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3
|
82
|
+
version: '3'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: factory_bot
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,7 +126,7 @@ description: This gem is almost a straight copy and paste of https://github.com/
|
|
112
126
|
with the Rails specific code stripped out so it can be used in Rack applications
|
113
127
|
that don't use Rails.
|
114
128
|
email:
|
115
|
-
- eugene@
|
129
|
+
- eugene.howe@protonmail.com
|
116
130
|
executables: []
|
117
131
|
extensions: []
|
118
132
|
extra_rdoc_files: []
|