rails-param-validation 0.3.0 → 0.3.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: 1e81185301762be6703608dfc575c27813c49fde9969057c0b821c7cc78f7680
4
- data.tar.gz: 5c3c75f3d2a8e6275d1c794540d972e62b13ada2592a5602ca71bb80794d6f05
3
+ metadata.gz: 379a0af49ad44233f32c49a193e2eabae05b111330d93316c87d83968ea0693e
4
+ data.tar.gz: a0db01c2e6c16a1f0b1ed940d7c54d3c347fb46532119bc737dab460889a3b84
5
5
  SHA512:
6
- metadata.gz: 1af2e48e2ef3d6af489e009177839378b5e19b8817a456a9cb1e399e525b2a974d52ed1986a321c44035248c527d8ef1b7711de0e175252791a12567a8bd98da
7
- data.tar.gz: b4528b9e92d0c7079cced511255760766771ba6b6f9e5f013d8f1049bdf1fce6f10f86750760bae7ebb12d53ce66b027d18d4228c7dd953d5f1e6fa70af60979
6
+ metadata.gz: 7d5b1a95b756da8407b90d8cc8acff4910aa3d3f81af2bdbd740b04fdc8defb38737eb09e60ed2c1a430c8b27b70db6dcad3c85d579b16809a7cb1230d1b08a6
7
+ data.tar.gz: 8f66b039139bf738674123a44168083fc94a6d00c2eee3255d2853e27746f98403a622ca9302accc92fd7f199f181a78e35e2d0d6392102e23ba45650f9d2b10
@@ -1,6 +1,8 @@
1
1
  module RailsParamValidation
2
2
 
3
3
  class ConstantValidator < Validator
4
+ CLASS_MAP = { TrueClass => Boolean, FalseClass => Boolean }
5
+
4
6
  def initialize(schema)
5
7
  super schema
6
8
 
@@ -21,7 +23,7 @@ module RailsParamValidation
21
23
  end
22
24
 
23
25
  def to_openapi
24
- ValidatorFactory.create(schema.class).to_openapi.merge(enum: [schema])
26
+ ValidatorFactory.create(CLASS_MAP.fetch(schema.class, schema.class)).to_openapi.merge(enum: [schema])
25
27
  end
26
28
  end
27
29
 
@@ -35,4 +37,4 @@ module RailsParamValidation
35
37
  end
36
38
  end
37
39
 
38
- end
40
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsParamValidation
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-param-validation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oskar Kirmis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-27 00:00:00.000000000 Z
11
+ date: 2020-07-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Declarative parameter definition and validation for Rails
14
14
  email: