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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95eb8012259c21946fe6b6ab07aaa4da3b29f5d3746b0581d12a6f67b39f8f5c
4
- data.tar.gz: d775af4081190de942d2e6d978a922dd37083c9d0a59638cd16259d1c9ad8295
3
+ metadata.gz: 7c0ed44b6b2952d8465e521a0cff59729c73d1a8f6103e23baaae0ce8087a8d6
4
+ data.tar.gz: faec9887999f9c6093e2a85f8578945d9de832c4f1471a23553b9627012d3617
5
5
  SHA512:
6
- metadata.gz: 669a66d91c6b2e6d47648a30d44829a5713ee4b0170626953359ed3df5b66f14b21ea76d84654ea4bcafb14f1fe622ce8ac8338de98df530a8d19ef47275fc0b
7
- data.tar.gz: 92617f0c507187d52c88a07324fc0081503d5095c4bd7f192fb65d252c9dff38ae52da708f2e38665430f6f9d506703e1e1fdc95f4dc0b4c621a33ef577802a0
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::InRange.new(
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.11.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.16.0)
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.1)
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.2)
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.2)
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.
@@ -27,6 +27,8 @@ module SoberSwag
27
27
  self | Null.new
28
28
  end
29
29
 
30
+ alias nilable optional
31
+
30
32
  ##
31
33
  # A list of this input.
32
34
  #
@@ -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, 'input type must be a SoberSwag::Reporting::Input::Interface' unless input.is_a?(Interface)
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
 
@@ -8,6 +8,8 @@ module SoberSwag
8
8
  ##
9
9
  # @param problems [Array<String>] problems with it
10
10
  def initialize(problems)
11
+ raise ArgumentError, "#{problems} was not an enum" unless problems.respond_to?(:each)
12
+
11
13
  @problems = problems
12
14
  end
13
15
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SoberSwag
4
- VERSION = '0.25.0'
4
+ VERSION = '0.25.1'
5
5
  end
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.0
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-06-07 00:00:00.000000000 Z
11
+ date: 2022-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport