dry-schema 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/dry/schema/message_compiler.rb +4 -13
- data/lib/dry/schema/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: '07179bd67f80d0a500d2484a2169f09804612a38ce9601819203d89bc0d109a1'
|
4
|
+
data.tar.gz: 1337a9d5197257e3bc773f87af7785e4297624b3d10699ea5b9c977be4a19a67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10b8ea1df48c45fa50bcc35be0d7e9785c90285fb29bdc0ad712745803280f9de53ea80643dccefd923df263ba20973cd2b4956dd2d773701ff4ad9050ab3742
|
7
|
+
data.tar.gz: 42776d375539ec537361f2c6e95c027020107e6f92bd14a866ed1b37e10af5ae0037eb0866278aa8877ce62f617222201b34f58db3e43925ae89f46585359a9a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 1.6.1 2021-02-02
|
4
|
+
|
5
|
+
|
6
|
+
### Fixed
|
7
|
+
|
8
|
+
- Messages#[] handles meta/no meta cases more gracefully and has better interoperability with the I18n backend. This brings MessageCompiler#visit_unexpected_key up to parity with MessageCompiler#visit_predicate. Uses visit_predicate as basis for visit_unexpected_key. (@robhanlon22)
|
9
|
+
|
10
|
+
|
11
|
+
[Compare v1.6.0...v1.6.1](https://github.com/dry-rb/dry-schema/compare/v1.6.0...v1.6.1)
|
12
|
+
|
3
13
|
## 1.6.0 2021-01-21
|
4
14
|
|
5
15
|
|
@@ -4,8 +4,9 @@ require "dry/initializer"
|
|
4
4
|
|
5
5
|
require "dry/schema/constants"
|
6
6
|
require "dry/schema/message"
|
7
|
-
require "dry/schema/message_set"
|
8
7
|
require "dry/schema/message_compiler/visitor_opts"
|
8
|
+
require "dry/schema/message_set"
|
9
|
+
require "dry/schema/path"
|
9
10
|
|
10
11
|
module Dry
|
11
12
|
module Schema
|
@@ -109,18 +110,8 @@ module Dry
|
|
109
110
|
end
|
110
111
|
|
111
112
|
# @api private
|
112
|
-
def visit_unexpected_key(node,
|
113
|
-
|
114
|
-
|
115
|
-
msg = messages.translate("errors.unexpected_key")
|
116
|
-
|
117
|
-
Message.new(
|
118
|
-
path: path,
|
119
|
-
meta: msg[:meta] || EMPTY_HASH,
|
120
|
-
text: msg[:text],
|
121
|
-
predicate: nil,
|
122
|
-
input: input
|
123
|
-
)
|
113
|
+
def visit_unexpected_key(node, opts)
|
114
|
+
visit_predicate([:unexpected_key, []], opts.dup.update(path: Path[node.first]))
|
124
115
|
end
|
125
116
|
|
126
117
|
# @api private
|
data/lib/dry/schema/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|