sober_swag 0.25.0 → 0.25.1
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/CHANGELOG.md +5 -0
- data/docs/reporting.md +1 -4
- data/example/Gemfile.lock +5 -5
- data/lib/sober_swag/reporting/input/converting/decimal.rb +1 -1
- data/lib/sober_swag/reporting/input/interface.rb +2 -0
- data/lib/sober_swag/reporting/input/struct.rb +1 -1
- data/lib/sober_swag/reporting/report/value.rb +2 -0
- data/lib/sober_swag/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c0ed44b6b2952d8465e521a0cff59729c73d1a8f6103e23baaae0ce8087a8d6
|
|
4
|
+
data.tar.gz: faec9887999f9c6093e2a85f8578945d9de832c4f1471a23553b9627012d3617
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3641dfc6dbe689cb540c0f036baa32f8d99879b36748a3f04ffa3c2d39ef9d6b9224e8eb8bb91fb304bb2e9b0069b3254c3c33f328bbae1d747899ed8cf39bb3
|
|
7
|
+
data.tar.gz: 1bd7d20511c9326bf33d73e2cf081fbe729fbda2fbb5dad7fd7cd1780e1bc8bcf4b456492395d70c2313c0a01ae6cf021d6ccb773f7369abc7eb18d8713b831a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v0.25.1] 2022-07-2021
|
|
4
|
+
|
|
5
|
+
- Stricer validation on report arguments
|
|
6
|
+
- Fix a bad report argument
|
|
7
|
+
|
|
3
8
|
## [v0.25.0] 2022-06-07
|
|
4
9
|
|
|
5
10
|
- Adds more description to the error raised if you try to use a non-reporting output type as the output of a field
|
data/docs/reporting.md
CHANGED
|
@@ -418,10 +418,7 @@ The validations provided match the specifications in swagger.
|
|
|
418
418
|
You can use it like:
|
|
419
419
|
|
|
420
420
|
```ruby
|
|
421
|
-
SoberSwag::Reporting::Input
|
|
422
|
-
SoberSwag::Reporting::Input::Number,
|
|
423
|
-
1..100
|
|
424
|
-
)
|
|
421
|
+
SoberSwag::Reporting::Input.number.in_range(1..100)
|
|
425
422
|
```
|
|
426
423
|
- `SoberSwag::Reporting::Input::MultipleOf`, which specifies that a number is a *multiple of* some other number.
|
|
427
424
|
You can use it like this:
|
data/example/Gemfile.lock
CHANGED
|
@@ -64,7 +64,7 @@ GEM
|
|
|
64
64
|
minitest (~> 5.1)
|
|
65
65
|
tzinfo (~> 1.1)
|
|
66
66
|
zeitwerk (~> 2.2, >= 2.2.2)
|
|
67
|
-
bootsnap (1.
|
|
67
|
+
bootsnap (1.12.0)
|
|
68
68
|
msgpack (~> 1.2)
|
|
69
69
|
builder (3.2.4)
|
|
70
70
|
byebug (11.1.3)
|
|
@@ -107,7 +107,7 @@ GEM
|
|
|
107
107
|
listen (3.7.1)
|
|
108
108
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
109
109
|
rb-inotify (~> 0.9, >= 0.9.10)
|
|
110
|
-
loofah (2.
|
|
110
|
+
loofah (2.18.0)
|
|
111
111
|
crass (~> 1.0.2)
|
|
112
112
|
nokogiri (>= 1.5.9)
|
|
113
113
|
mail (2.7.1)
|
|
@@ -117,7 +117,7 @@ GEM
|
|
|
117
117
|
mini_mime (1.1.2)
|
|
118
118
|
mini_portile2 (2.8.0)
|
|
119
119
|
minitest (5.15.0)
|
|
120
|
-
msgpack (1.5.
|
|
120
|
+
msgpack (1.5.2)
|
|
121
121
|
nio4r (2.5.8)
|
|
122
122
|
nokogiri (1.13.6)
|
|
123
123
|
mini_portile2 (~> 2.8.0)
|
|
@@ -149,7 +149,7 @@ GEM
|
|
|
149
149
|
rails-dom-testing (2.0.3)
|
|
150
150
|
activesupport (>= 4.2.0)
|
|
151
151
|
nokogiri (>= 1.6)
|
|
152
|
-
rails-html-sanitizer (1.4.
|
|
152
|
+
rails-html-sanitizer (1.4.3)
|
|
153
153
|
loofah (~> 2.3)
|
|
154
154
|
railties (6.0.4.1)
|
|
155
155
|
actionpack (= 6.0.4.1)
|
|
@@ -189,7 +189,7 @@ GEM
|
|
|
189
189
|
actionpack (>= 5.2)
|
|
190
190
|
activesupport (>= 5.2)
|
|
191
191
|
sprockets (>= 3.0.0)
|
|
192
|
-
sqlite3 (1.4.
|
|
192
|
+
sqlite3 (1.4.4)
|
|
193
193
|
thor (1.2.1)
|
|
194
194
|
thread_safe (0.3.6)
|
|
195
195
|
tzinfo (1.2.9)
|
|
@@ -12,7 +12,7 @@ module SoberSwag
|
|
|
12
12
|
.mapped do |v|
|
|
13
13
|
BigDecimal(v)
|
|
14
14
|
rescue ArgumentError
|
|
15
|
-
Report::Value.new('was not a decimal')
|
|
15
|
+
Report::Value.new(['was not a decimal'])
|
|
16
16
|
end).described(<<~MARKDOWN).referenced('SoberSwag.Converting.Decimal')
|
|
17
17
|
Decimal formatted input.
|
|
18
18
|
Will either convert a JSON number to a decimal, or accept a string representation.
|
|
@@ -76,7 +76,7 @@ module SoberSwag
|
|
|
76
76
|
#
|
|
77
77
|
def add_attribute!(name, input, required:, description: nil)
|
|
78
78
|
raise ArgumentError, 'name must be a symbol' unless name.is_a?(Symbol)
|
|
79
|
-
raise ArgumentError,
|
|
79
|
+
raise ArgumentError, "input type must be a SoberSwag::Reporting::Input::Interface (at key #{name.inspect})" unless input.is_a?(Interface)
|
|
80
80
|
|
|
81
81
|
define_attribute(name) # defines an instance method to access this attribute
|
|
82
82
|
|
data/lib/sober_swag/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sober_swag
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.25.
|
|
4
|
+
version: 0.25.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anthony Super
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-07-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|