typed_params 1.2.2 → 1.2.4
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 +8 -0
- data/lib/typed_params/formatters/jsonapi.rb +1 -1
- data/lib/typed_params/schema.rb +7 -6
- data/lib/typed_params/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: 5f9d9f861e13643b5a7a2b838a044b57b21d278fc675f73b0fbbef6796c45570
|
4
|
+
data.tar.gz: 90f1efd567af8306b47dc45966eb4b7aa60604a4a4fe3b6a7f131623f3a098c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c13b18a4cbe8053b7257d1e48b69e91079ceb64ebc726593efc1b42824b140f9142376a92ba85c87e6e9f6a8e3906b8aa49b025e6d8a9a03c7bcca111acc7c92
|
7
|
+
data.tar.gz: fde46708d885ef36fa4c18deebb7da4f374236ca6d72b15916bcd88a77b8a29ceb7d79ab8ab2a8a861c8bcde7c203076c88e02d51ab6be9c097f18389a82bd7f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.2.4
|
4
|
+
|
5
|
+
- Fix issue where both `minimum` and `maximum` constraints could not be added to a `length:` validator.
|
6
|
+
|
7
|
+
## 1.2.3
|
8
|
+
|
9
|
+
- Remove `alias` from child lookup criteria in JSONAPI serializer.
|
10
|
+
|
3
11
|
## 1.2.2
|
4
12
|
|
5
13
|
- Fix issue where `as:` keyword was not handled in JSONAPI relationship formatter.
|
@@ -80,7 +80,7 @@ module TypedParams
|
|
80
80
|
relationships&.each do |key, relationship|
|
81
81
|
child = schema.children.fetch(:relationships).then do |rels|
|
82
82
|
rels.children.fetch(key) {
|
83
|
-
rels.children.values.find { _1.as == key
|
83
|
+
rels.children.values.find { _1.as == key }
|
84
84
|
}
|
85
85
|
end
|
86
86
|
|
data/lib/typed_params/schema.rb
CHANGED
@@ -66,13 +66,14 @@ module TypedParams
|
|
66
66
|
format.key?(:without)
|
67
67
|
)
|
68
68
|
|
69
|
-
raise ArgumentError, 'length must be a hash with :minimum, :maximum, :within, :in, or :is keys (but not multiple)' unless
|
69
|
+
raise ArgumentError, 'length must be a hash with :minimum, :maximum, :within, :in, or :is keys (but not multiple except for :minimum and :maximum)' unless
|
70
70
|
length.nil? || length.is_a?(Hash) && (
|
71
|
-
length.key?(:minimum)
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
71
|
+
length.key?(:minimum) && length.key?(:maximum) && length.size == 2 ||
|
72
|
+
length.key?(:minimum) ^
|
73
|
+
length.key?(:maximum) ^
|
74
|
+
length.key?(:within) ^
|
75
|
+
length.key?(:in) ^
|
76
|
+
length.key?(:is)
|
76
77
|
)
|
77
78
|
|
78
79
|
@controller = controller
|
data/lib/typed_params/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typed_params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zeke Gabrielse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|