dry-validation 1.0.0 → 1.5.6
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 +379 -141
- data/LICENSE +1 -1
- data/README.md +7 -8
- data/dry-validation.gemspec +41 -0
- data/lib/dry-validation.rb +1 -1
- data/lib/dry/validation.rb +10 -5
- data/lib/dry/validation/config.rb +2 -2
- data/lib/dry/validation/constants.rb +9 -2
- data/lib/dry/validation/contract.rb +34 -17
- data/lib/dry/validation/contract/class_interface.rb +62 -56
- data/lib/dry/validation/evaluator.rb +50 -13
- data/lib/dry/validation/extensions/hints.rb +1 -3
- data/lib/dry/validation/extensions/monads.rb +1 -1
- data/lib/dry/validation/extensions/predicates_as_macros.rb +75 -0
- data/lib/dry/validation/failures.rb +15 -3
- data/lib/dry/validation/function.rb +13 -10
- data/lib/dry/validation/macro.rb +2 -2
- data/lib/dry/validation/macros.rb +3 -3
- data/lib/dry/validation/message.rb +4 -4
- data/lib/dry/validation/message_set.rb +6 -51
- data/lib/dry/validation/messages/resolver.rb +60 -5
- data/lib/dry/validation/result.rb +47 -8
- data/lib/dry/validation/rule.rb +43 -12
- data/lib/dry/validation/schema_ext.rb +19 -0
- data/lib/dry/validation/values.rb +38 -11
- data/lib/dry/validation/version.rb +1 -1
- metadata +31 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baed168e736076bb6f402d21c43f79b7f14014d2c86c2cb4c5ff0d286ed340b1
|
4
|
+
data.tar.gz: 648d5963b3d6a25c71e9bac28ff3476318599f50c989d2299486f826109b4015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5de2142ce8dc474eded404e9f13904ab824dd044ad6be1e3054773b0846ee5987c3008244dacab8595cce94cbb500fb30e3f1a8d435bbed8e400e64065c1c80a
|
7
|
+
data.tar.gz: bfbf80ec801ad412437f3f7a95f205d4f85004ba1ff93af61db4c21deb01063bb39b6e389eac761728721de55e14716e16e7eb07d9f53771f4ea18d7564a00b7
|
data/CHANGELOG.md
CHANGED
@@ -1,20 +1,231 @@
|
|
1
|
-
|
1
|
+
## 1.5.5
|
2
2
|
|
3
|
-
|
3
|
+
2020-09-04
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
|
7
|
+
- Dependency on dry-schema was bumped to >= 1.5.1. This time for real (@solnic)
|
8
|
+
|
9
|
+
|
10
|
+
[Compare v1.5.5...master](https://github.com/dry-rb/dry-validation/compare/v1.5.5...master)
|
11
|
+
|
12
|
+
## 1.5.5
|
13
|
+
|
14
|
+
2020-09-03
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
|
18
|
+
- Dependency on dry-schema was bumped to >= 1.5.2 (see #666 for more info) (@artofhuman)
|
19
|
+
|
20
|
+
|
21
|
+
[Compare v1.5.4...master](https://github.com/dry-rb/dry-validation/compare/v1.5.4...master)
|
22
|
+
|
23
|
+
## 1.5.4 2020-08-21
|
24
|
+
|
25
|
+
|
26
|
+
### Added
|
27
|
+
|
28
|
+
- You can now pass any key or a path to the rule's `key?` helper (see #664 for more info) (@alassek)
|
29
|
+
|
30
|
+
### Fixed
|
31
|
+
|
32
|
+
- Full messages work correctly with rule failures now (issue #661 fixed via #662) (@stind)
|
33
|
+
- Providing a custom message template for array errors works correctly (issue #663 fixed via #665) (@tadeusz-niemiec)
|
34
|
+
|
35
|
+
|
36
|
+
[Compare v1.5.3...v1.5.4](https://github.com/dry-rb/dry-validation/compare/v1.5.3...v1.5.4)
|
37
|
+
|
38
|
+
## 1.5.3 2020-07-27
|
39
|
+
|
40
|
+
|
41
|
+
### Added
|
42
|
+
|
43
|
+
- You can now access current value's index via `rule(:foo).each do |index:|` (issue #606 done via #657) (@mrbongiolo)
|
44
|
+
|
45
|
+
### Fixed
|
46
|
+
|
47
|
+
- Using `.each(:foo)` works as expected when there are errors related to other keys (issue #659 fixed via #660) (@solnic)
|
48
|
+
|
49
|
+
### Changed
|
50
|
+
|
51
|
+
- `Result#error?` is now a public API and it takes into consideration both schema and rule errors (issue #655 fixed via #656) (@PragTob)
|
52
|
+
|
53
|
+
[Compare v1.5.2...v1.5.3](https://github.com/dry-rb/dry-validation/compare/v1.5.2...v1.5.3)
|
54
|
+
|
55
|
+
## 1.5.2 2020-07-14
|
56
|
+
|
57
|
+
|
58
|
+
### Fixed
|
59
|
+
|
60
|
+
- `key?` predicate in rules no longer crashes when the rule path points to a non-existent array value (issue #653 fixed via #654) (@solnic)
|
61
|
+
|
62
|
+
|
63
|
+
[Compare v1.5.1...v1.5.2](https://github.com/dry-rb/dry-validation/compare/v1.5.1...v1.5.2)
|
64
|
+
|
65
|
+
## 1.5.1 2020-06-18
|
66
|
+
|
67
|
+
|
68
|
+
### Fixed
|
69
|
+
|
70
|
+
- dry-monads no longer required for the `:hints` extension (@schokomarie)
|
71
|
+
- Using `full: true` option works as expected with custom rule messages (issue #618 fixed via #651) (@sirfilip)
|
72
|
+
- Using `locale: ...` option works as expected with hints (issue #589 fixed via 652) (@sirfilip)
|
73
|
+
|
74
|
+
|
75
|
+
[Compare v1.5.0...v1.5.1](https://github.com/dry-rb/dry-validation/compare/v1.5.0...v1.5.1)
|
76
|
+
|
77
|
+
## 1.5.0 2020-03-11
|
78
|
+
|
79
|
+
|
80
|
+
### Added
|
81
|
+
|
82
|
+
- `schema_error?` rule helper (@waiting-for-dev)
|
83
|
+
- `rule_error?` rule helper (@waiting-for-dev)
|
84
|
+
|
85
|
+
### Changed
|
86
|
+
|
87
|
+
- dry-schema dependency was bumped to `~> 1.5` (@solnic)
|
88
|
+
- [internal] `KeyMap` patches have been removed since dry-schema now provides required functionality (@solnic)
|
89
|
+
|
90
|
+
[Compare v1.4.2...v1.5.0](https://github.com/dry-rb/dry-validation/compare/v1.4.2...v1.5.0)
|
91
|
+
|
92
|
+
## 1.4.2 2020-01-18
|
93
|
+
|
94
|
+
|
95
|
+
### Fixed
|
96
|
+
|
97
|
+
- Macros using predicates that accept a range argument work as expected (no need to wrap the argument in an array) (@waiting-for-dev)
|
98
|
+
|
99
|
+
|
100
|
+
[Compare v1.4.1...v1.4.2](https://github.com/dry-rb/dry-validation/compare/v1.4.1...v1.4.2)
|
101
|
+
|
102
|
+
## 1.4.1 2020-01-08
|
103
|
+
|
104
|
+
|
105
|
+
### Added
|
106
|
+
|
107
|
+
- Pattern matching on result values (@flash-gordon)
|
108
|
+
|
109
|
+
### Fixed
|
110
|
+
|
111
|
+
- List tokens are correctly interpolated as a comma separated list in rule messages (see #611) (@waiting-for-dev)
|
112
|
+
- Warnings about delegated keywords (@flash-gordon)
|
113
|
+
|
114
|
+
|
115
|
+
[Compare v1.4.0...v1.4.1](https://github.com/dry-rb/dry-validation/compare/v1.4.0...v1.4.1)
|
116
|
+
|
117
|
+
## 1.4.0 2019-12-12
|
118
|
+
|
119
|
+
|
120
|
+
### Added
|
121
|
+
|
122
|
+
- Support for multi-schema inheritance (@ianwhite)
|
123
|
+
|
124
|
+
### Fixed
|
125
|
+
|
126
|
+
- Keyword warnings reported by Ruby 2.7 (@flash-gordon)
|
127
|
+
- Fixed an issue where `MessageSet` would be marked as empty too early (@ianwhite)
|
128
|
+
- Messages are correctly generated when there are errors for both an array and one or more of its elements (see #599) (@Bugagazavr)
|
129
|
+
|
130
|
+
### Changed
|
131
|
+
|
132
|
+
- A meaningful exception is raised when failure options are not valid (@MatElGran)
|
133
|
+
- [internal] improved performance in `Contract.ensure_valid_keys` (@grzegorz-jakubiak)
|
134
|
+
- [internal] fixed keyword warnings on MRI 2.7.0 (@flash-gordon)
|
135
|
+
|
136
|
+
[Compare v1.3.1...v1.4.0](https://github.com/dry-rb/dry-validation/compare/v1.3.1...v1.4.0)
|
137
|
+
|
138
|
+
## 1.3.1 2019-08-16
|
139
|
+
|
140
|
+
|
141
|
+
### Changed
|
142
|
+
|
143
|
+
- You can now set an external schema without providing a block (@alassek)
|
144
|
+
|
145
|
+
[Compare v1.3.0...v1.3.1](https://github.com/dry-rb/dry-validation/compare/v1.3.0...v1.3.1)
|
146
|
+
|
147
|
+
## 1.3.0 2019-08-14
|
148
|
+
|
149
|
+
|
150
|
+
### Added
|
151
|
+
|
152
|
+
- Support for setting an external schema (that can be extended too) (fixed #574) (@solnic)
|
153
|
+
|
154
|
+
### Fixed
|
155
|
+
|
156
|
+
- Using a hash spec to define rule keys with more than one value is properly handled by rule guard now (fixed #576) (@solnic)
|
157
|
+
|
158
|
+
### Changed
|
159
|
+
|
160
|
+
- `values` within rules uses `Hash#fetch_values` internally now, which improves performance (@esparta)
|
161
|
+
|
162
|
+
[Compare v1.2.1...v1.3.0](https://github.com/dry-rb/dry-validation/compare/v1.2.1...v1.3.0)
|
163
|
+
|
164
|
+
## 1.2.1 2019-07-16
|
165
|
+
|
166
|
+
|
167
|
+
### Fixed
|
168
|
+
|
169
|
+
- Defining an abstract contract class that has no schema no longer crashes (issue #565) (@solnic)
|
170
|
+
- Fixed an issue where `Rule#each` would crash when the value is not an array (issue #567) (@solnic)
|
171
|
+
- Fixed an issue where guarding a rule would crash when keys are missing in the input (issue #569) (@solnic)
|
172
|
+
- Added missing "pathname" require (issue #570) (@solnic)
|
173
|
+
|
174
|
+
|
175
|
+
[Compare v1.2.0...v1.2.1](https://github.com/dry-rb/dry-validation/compare/v1.2.0...v1.2.1)
|
176
|
+
|
177
|
+
## 1.2.0 2019-07-08
|
178
|
+
|
179
|
+
|
180
|
+
### Added
|
181
|
+
|
182
|
+
- New extension `:predicates_as_macros` (@waiting-for-dev)
|
183
|
+
|
184
|
+
### Fixed
|
185
|
+
|
186
|
+
- Guarding rules for nested keys works correctly (issue #560) (@solnic)
|
187
|
+
|
188
|
+
### Changed
|
189
|
+
|
190
|
+
- `dry-schema` dependency was bumped to `>= 1.3.1` (@solnic)
|
191
|
+
|
192
|
+
[Compare v1.1.1...v1.2.0](https://github.com/dry-rb/dry-validation/compare/v1.1.1...v1.2.0)
|
193
|
+
|
194
|
+
## 1.1.1 2019-06-24
|
195
|
+
|
196
|
+
|
197
|
+
### Fixed
|
198
|
+
|
199
|
+
- `Rule#each` works with array values from nested hashes (@mustardnoise)
|
200
|
+
|
201
|
+
|
202
|
+
[Compare v1.1.0...v1.1.1](https://github.com/dry-rb/dry-validation/compare/v1.1.0...v1.1.1)
|
203
|
+
|
204
|
+
## 1.1.0 2019-06-14
|
205
|
+
|
206
|
+
|
207
|
+
### Added
|
208
|
+
|
209
|
+
- `key?` method available within rules, that can be used to check if there's a value under the rule's default key (refs #540) (@solnic)
|
210
|
+
- `value` supports hash-based path specifications now (refs #547) (@solnic)
|
211
|
+
- `value` can read multiple values when the key points to them, ie in case of `rule(geo: [:lat, :lon])` it would return an array with `lat` and `lon` (@solnic)
|
212
|
+
|
213
|
+
### Fixed
|
214
|
+
|
215
|
+
- Passing multiple macro names to `validate` or `each` works correctly (fixed #538 #541) (@jandudulski)
|
216
|
+
|
217
|
+
|
218
|
+
[Compare v1.0.0...v1.1.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0...v1.1.0)
|
219
|
+
|
220
|
+
## 1.0.0 2019-06-10
|
4
221
|
|
5
222
|
See [the list of all addressed issues](https://github.com/dry-rb/dry-validation/issues?utf8=✓&q=is%3Aissue+is%3Aclosed+closed%3A%3E%3D2019-01-01+) as well as issues that were moved to dry-schema and [addressed there](https://github.com/dry-rb/dry-schema/issues?q=is%3Aissue+is%3Aclosed+dry-validation+milestone%3A1.0.0).
|
6
223
|
|
7
|
-
### :sparkles: Release highlights :sparkles:
|
8
224
|
|
9
|
-
-
|
10
|
-
- Improved message backends with support for `key` and `base` messages, and arbitrary meta-data (like error codes etc.)
|
11
|
-
- Support for defining rules for array elements ie `rule(:items).each { ... }`
|
12
|
-
- Support for macros that encapsulate common rule logic
|
13
|
-
- Built-in `:acceptance` macro
|
225
|
+
[Compare v1.0.0...v1.0.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0...v1.0.0)
|
14
226
|
|
15
|
-
|
227
|
+
## 1.0.0 2019-06-10
|
16
228
|
|
17
|
-
# v1.0.0 2019-06-10 (compared to 1.0.0.rc3)
|
18
229
|
|
19
230
|
### Added
|
20
231
|
|
@@ -37,65 +248,69 @@ See [the list of all addressed issues](https://github.com/dry-rb/dry-validation/
|
|
37
248
|
|
38
249
|
[Compare v1.0.0.rc3...v1.0.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0.rc3...v1.0.0)
|
39
250
|
|
40
|
-
|
251
|
+
## 1.0.0.rc3 2019-05-06
|
252
|
+
|
41
253
|
|
42
254
|
### Added
|
43
255
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
256
|
+
- [EXPERIMENTAL] `Validation.register_macro` for registering global macros (solnic)
|
257
|
+
- [EXPERIMENTAL] `Contract.register_macro` for registering macros available to specific contract classes (solnic)
|
258
|
+
- `Dry::Validation.Contract` shortcut for quickly defining a contract and getting its instance back (solnic)
|
259
|
+
- New configuration option `config.locale` for setting the default locale (solnic)
|
48
260
|
|
49
261
|
### Fixed
|
50
262
|
|
51
|
-
|
263
|
+
- `config/errors.yml` are now bundled with the gem, **`rc2` was broken because of this** (solnic)
|
264
|
+
|
52
265
|
|
53
266
|
[Compare v1.0.0.rc2...v1.0.0.rc3](https://github.com/dry-rb/dry-validation/compare/v1.0.0.rc2...v1.0.0.rc3)
|
54
267
|
|
55
|
-
|
268
|
+
## 1.0.0.rc2 2019-05-04
|
56
269
|
|
57
270
|
This was **yanked** on rubygems.org because the bundled gem was missing `config` directory, thus it was not possible to require it. It was fixed in `rc3`.
|
58
271
|
|
59
272
|
### Added
|
60
273
|
|
61
|
-
|
62
|
-
|
274
|
+
- [EXPERIMENTAL] support for registering macros via `Dry::Validation::Macros.register(:your_macro, &block)` (solnic)
|
275
|
+
- [EXPERIMENTAL] `:acceptance` as the first built-in macro (issue #157) (solnic)
|
63
276
|
|
64
277
|
### Fixed
|
65
278
|
|
66
|
-
|
279
|
+
- Passing invalid argument to `failure` will raise a meaningful error instead of crashing (solnic)
|
67
280
|
|
68
281
|
### Changed
|
69
282
|
|
70
|
-
|
71
|
-
|
283
|
+
- In rule validation blocks, `values` is now an instance of a hash-like `Dry::Validation::Values` class, rather than `Dry::Schema::Result`. This gives more convenient access to data within rules (solnic)
|
284
|
+
- Dependency on `dry-schema` was updated to `~> 1.0` (solnic)
|
72
285
|
|
73
286
|
[Compare v1.0.0.rc1...v1.0.0.rc2](https://github.com/dry-rb/dry-validation/compare/v1.0.0.rc1...v1.0.0.rc2)
|
74
287
|
|
75
|
-
|
288
|
+
## 1.0.0.rc1 2019-04-26
|
289
|
+
|
76
290
|
|
77
291
|
### Added
|
78
292
|
|
79
|
-
|
80
|
-
|
293
|
+
- `:hints` extension is back (solnic)
|
294
|
+
- `Result` objects have access to the context object which is shared between rules (flash-gordon)
|
81
295
|
|
82
296
|
### Fixed
|
83
297
|
|
84
|
-
|
85
|
-
|
298
|
+
- Multiple hint messages no longer crash message set (flash-gordon)
|
299
|
+
- `Contract#inspect` no longer crashes (solnic)
|
86
300
|
|
87
301
|
### Changed
|
88
302
|
|
89
|
-
|
90
|
-
|
303
|
+
- Dependency on `dry-schema` was bumped to `~> 0.6` - this pulls in `dry-types 1.0.0` and `dry-logic 1.0.0` (solnic)
|
304
|
+
- Dependency on `dry-initializer` was bumped to `~> 3.0` (solnic)
|
91
305
|
|
92
306
|
[Compare v1.0.0.beta2...v1.0.0.rc1](https://github.com/dry-rb/dry-validation/compare/v1.0.0.beta2...v1.0.0.rc1)
|
93
307
|
|
94
|
-
|
308
|
+
## 1.0.0.beta2 2019-04-04
|
309
|
+
|
95
310
|
|
96
311
|
### Added
|
97
312
|
|
98
|
-
|
313
|
+
- Support for arbitrary meta-data in failures, ie:
|
99
314
|
|
100
315
|
```ruby
|
101
316
|
class NewUserContract < Dry::Validation::Contract
|
@@ -113,98 +328,107 @@ This was **yanked** on rubygems.org because the bundled gem was missing `config`
|
|
113
328
|
|
114
329
|
### Changed
|
115
330
|
|
116
|
-
|
117
|
-
|
118
|
-
|
331
|
+
- [BREAKING] `Error` was renamed to `Message` as it is a more generic concept (solnic)
|
332
|
+
- [BREAKING] `ErrorSet` was renamed to `MessageSet` for consistency (solnic)
|
333
|
+
- [BREAKING] `:monads` extension wraps entire result objects in `Success` or `Failure` (flash-gordon)
|
119
334
|
|
120
335
|
[Compare v1.0.0.beta1...v1.0.0.beta2](https://github.com/dry-rb/dry-validation/compare/v1.0.0.beta1...v1.0.0.beta2)
|
121
336
|
|
122
|
-
|
337
|
+
## 1.0.0.beta1 2019-03-26
|
338
|
+
|
123
339
|
|
124
340
|
### Added
|
125
341
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
342
|
+
- New API for setting failures `base.failure` for base errors and `key.failure` for key errors (solnic)
|
343
|
+
- Support for `base` errors associated with a key even when child keys have errors too (solnic)
|
344
|
+
- Support for `base` errors not associated with any key (solnic)
|
345
|
+
- Result objects use `ErrorSet` object now for managing messages (solnic)
|
346
|
+
- Nested keys are properly handled when generating messages hash (issue #489) (flash-gordon + solnic)
|
347
|
+
- Result objects support `locale` and `full` options now (solnic)
|
348
|
+
- Ability to configure `top_namespace` for messages, which will be used for both schema and rule localization (solnic)
|
349
|
+
- Rule blocks receive a context object that you can use to share data between rules (solnic)
|
134
350
|
|
135
351
|
### Changed
|
136
352
|
|
137
|
-
|
138
|
-
|
139
|
-
|
353
|
+
- [BREAKING] `Result#errors` returns an instance of `ErrorSet` now, it's an enumerable, coerible to a hash (solnic)
|
354
|
+
- [BREAKING] `failure` was removed in favor of `key.failure` or `key(:foo).failure` (solnic)
|
355
|
+
- [BREAKING] `Result#to_hash` was removed (flash-gordon)
|
140
356
|
|
141
357
|
[Compare v1.0.0.alpha2...v1.0.0.beta1](https://github.com/dry-rb/dry-validation/compare/v1.0.0.alpha2...v1.0.0.beta1)
|
142
358
|
|
143
|
-
|
359
|
+
## 1.0.0.alpha2 2019-03-05
|
144
360
|
|
145
361
|
First round of bug fixes. Thanks for testing <3!
|
146
362
|
|
147
363
|
### Fixed
|
148
364
|
|
149
|
-
|
150
|
-
|
151
|
-
|
365
|
+
- Errors with nested messages are correctly built (flash-gordon)
|
366
|
+
- Messages for nested keys are correctly resolved (solnic)
|
367
|
+
- A message for a nested key is resolved when it's defined under `errors.rule.%{key}` too, but a message under nested key will override it (solnic)
|
152
368
|
|
153
369
|
### Changed
|
154
370
|
|
155
|
-
|
371
|
+
- When a message template is not found a more meaningful error is raised that includes both rule identifier and key path (solnic)
|
156
372
|
|
157
373
|
[Compare v1.0.0.alpha1...v1.0.0.alpha2](https://github.com/dry-rb/dry-validation/compare/v1.0.0.alpha1...v1.0.0.alpha2)
|
158
374
|
|
159
|
-
|
375
|
+
## 1.0.0.alpha1 2019-03-04
|
160
376
|
|
161
377
|
Complete rewrite on top of `dry-schema`.
|
162
378
|
|
163
379
|
### Added
|
164
380
|
|
165
|
-
|
166
|
-
|
381
|
+
- [BREAKING] `Dry::Validation::Contract` as a replacement for validation schemas (solnic)
|
382
|
+
- [BREAKING] New `rule` DSL with an improved API for setting error messages (solnic)
|
383
|
+
|
167
384
|
|
168
385
|
[Compare v0.13.0...v1.0.0.alpha1](https://github.com/dry-rb/dry-validation/compare/v0.13.0...v1.0.0.alpha1)
|
169
386
|
|
170
|
-
|
387
|
+
## 0.13.0 2019-01-29
|
171
388
|
|
172
|
-
### Changed
|
173
|
-
|
174
|
-
- `dry-logic` was bumped to `~> 0.5` (solnic)
|
175
|
-
- `dry-types` was bumped to `~> 0.14` (solnic)
|
176
389
|
|
177
390
|
### Fixed
|
178
391
|
|
179
392
|
- Warning about method redefined (amatsuda)
|
180
393
|
|
394
|
+
### Changed
|
395
|
+
|
396
|
+
- `dry-logic` was bumped to `~> 0.5` (solnic)
|
397
|
+
- `dry-types` was bumped to `~> 0.14` (solnic)
|
398
|
+
|
181
399
|
[Compare v0.12.3...v0.13.0](https://github.com/dry-rb/dry-validation/compare/v0.12.3...v0.13.0)
|
182
400
|
|
183
|
-
|
401
|
+
## 0.12.3 2019-01-29
|
402
|
+
|
184
403
|
|
185
404
|
### Changed
|
186
405
|
|
187
|
-
|
406
|
+
- [internal] dry-logic was pinned to `~> 0.4.2` (flash-gordon)
|
188
407
|
|
189
408
|
[Compare v0.12.2...v0.12.3](https://github.com/dry-rb/dry-validation/compare/v0.12.2...v0.12.3)
|
190
409
|
|
191
|
-
|
410
|
+
## 0.12.2 2018-08-29
|
411
|
+
|
192
412
|
|
193
413
|
### Fixed
|
194
414
|
|
195
415
|
- Use correct key names for rule messages when using i18n (jozzi05)
|
196
416
|
|
417
|
+
|
197
418
|
[Compare v0.12.1...v0.12.2](https://github.com/dry-rb/dry-validation/compare/v0.12.1...v0.12.2)
|
198
419
|
|
199
|
-
|
420
|
+
## 0.12.1 2018-07-06
|
421
|
+
|
200
422
|
|
201
423
|
### Fixed
|
202
424
|
|
203
425
|
- [internal] fixed deprecation warnings (flash-gordon)
|
204
426
|
|
427
|
+
|
205
428
|
[Compare v0.12.0...v0.12.1](https://github.com/dry-rb/dry-validation/compare/v0.12.0...v0.12.1)
|
206
429
|
|
207
|
-
|
430
|
+
## 0.12.0 2018-05-31
|
431
|
+
|
208
432
|
|
209
433
|
### Changed
|
210
434
|
|
@@ -213,7 +437,8 @@ Complete rewrite on top of `dry-schema`.
|
|
213
437
|
|
214
438
|
[Compare v0.11.1...v0.12.0](https://github.com/dry-rb/dry-validation/compare/v0.11.1...v0.12.0)
|
215
439
|
|
216
|
-
|
440
|
+
## 0.11.1 2017-09-15
|
441
|
+
|
217
442
|
|
218
443
|
### Changed
|
219
444
|
|
@@ -222,7 +447,8 @@ Complete rewrite on top of `dry-schema`.
|
|
222
447
|
|
223
448
|
[Compare v0.11.0...v0.11.1](https://github.com/dry-rb/dry-validation/compare/v0.11.0...v0.11.1)
|
224
449
|
|
225
|
-
|
450
|
+
## 0.11.0 2017-05-30
|
451
|
+
|
226
452
|
|
227
453
|
### Changed
|
228
454
|
|
@@ -230,32 +456,39 @@ Complete rewrite on top of `dry-schema`.
|
|
230
456
|
|
231
457
|
[Compare v0.10.7...v0.11.0](https://github.com/dry-rb/dry-validation/compare/v0.10.7...v0.11.0)
|
232
458
|
|
233
|
-
|
459
|
+
## 0.10.7 2017-05-15
|
460
|
+
|
234
461
|
|
235
462
|
### Fixed
|
236
463
|
|
237
464
|
- `validate` can now be defined multiple times for the same key (kimquy)
|
238
465
|
- Re-using rules between schemas no longer mutates original rule set (pabloh)
|
239
466
|
|
467
|
+
|
240
468
|
[Compare v0.10.6...v0.10.7](https://github.com/dry-rb/dry-validation/compare/v0.10.6...v0.10.7)
|
241
469
|
|
242
|
-
|
470
|
+
## 0.10.6 2017-04-26
|
471
|
+
|
243
472
|
|
244
473
|
### Fixed
|
245
474
|
|
246
475
|
- Fixes issue with wrong localized error messages when namespaced messages are used (kbredemeier)
|
247
476
|
|
477
|
+
|
248
478
|
[Compare v0.10.5...v0.10.6](https://github.com/dry-rb/dry-validation/compare/v0.10.5...v0.10.6)
|
249
479
|
|
250
|
-
|
480
|
+
## 0.10.5 2017-01-12
|
481
|
+
|
251
482
|
|
252
483
|
### Fixed
|
253
484
|
|
254
485
|
- Warnings under MRI 2.4.0 are gone (koic)
|
255
486
|
|
487
|
+
|
256
488
|
[Compare v0.10.4...v0.10.5](https://github.com/dry-rb/dry-validation/compare/v0.10.4...v0.10.5)
|
257
489
|
|
258
|
-
|
490
|
+
## 0.10.4 2016-12-03
|
491
|
+
|
259
492
|
|
260
493
|
### Fixed
|
261
494
|
|
@@ -268,31 +501,38 @@ Complete rewrite on top of `dry-schema`.
|
|
268
501
|
|
269
502
|
[Compare v0.10.3...v0.10.4](https://github.com/dry-rb/dry-validation/compare/v0.10.3...v0.10.4)
|
270
503
|
|
271
|
-
|
504
|
+
## 0.10.3 2016-09-27
|
505
|
+
|
272
506
|
|
273
507
|
### Fixed
|
274
508
|
|
275
509
|
- Custom predicates work correctly with `each` macro (solnic)
|
276
510
|
|
511
|
+
|
277
512
|
[Compare v0.10.2...v0.10.3](https://github.com/dry-rb/dry-validation/compare/v0.10.2...v0.10.3)
|
278
513
|
|
279
|
-
|
514
|
+
## 0.10.2 2016-09-23
|
515
|
+
|
280
516
|
|
281
517
|
### Fixed
|
282
518
|
|
283
519
|
- Constrained types + hints work again (solnic)
|
284
520
|
|
521
|
+
|
285
522
|
[Compare v0.10.1...v0.10.2](https://github.com/dry-rb/dry-validation/compare/v0.10.1...v0.10.2)
|
286
523
|
|
287
|
-
|
524
|
+
## 0.10.1 2016-09-22
|
525
|
+
|
288
526
|
|
289
527
|
### Fixed
|
290
528
|
|
291
529
|
- Remove obsolete require of `dry/struct` which is now an optional extension (flash-gordon)
|
292
530
|
|
531
|
+
|
293
532
|
[Compare v0.10.0...v0.10.1](https://github.com/dry-rb/dry-validation/compare/v0.10.0...v0.10.1)
|
294
533
|
|
295
|
-
|
534
|
+
## 0.10.0 2016-09-21
|
535
|
+
|
296
536
|
|
297
537
|
### Added
|
298
538
|
|
@@ -315,34 +555,31 @@ Complete rewrite on top of `dry-schema`.
|
|
315
555
|
- [BREAKING] `when` macro no longer supports multiple disconnected rules in its block, whatever the block returns will be used for the implication (solnic)
|
316
556
|
- [BREAKING] `rule(some_name: %i(some keys))` will _always_ use `:some_name` as the key for failure messages (solnic)
|
317
557
|
|
318
|
-
### Internal
|
319
|
-
|
320
|
-
- ~2 x performance boost (solnic)
|
321
|
-
- Rule AST was updated to latest dry-logic (solnic)
|
322
|
-
- `MessageCompiler` was drastically simplified based on the new result AST from dry-logic (solnic)
|
323
|
-
- `HintCompiler` is gone as hints are now part of the result AST (solnic)
|
324
|
-
- `maybe` macro creates an implication instead of a disjunction (`not(none?).then(*your-predicates)`) (solnic)
|
325
|
-
|
326
558
|
[Compare v0.9.5...v0.10.0](https://github.com/dry-rb/dry-validation/compare/v0.9.5...v0.10.0)
|
327
559
|
|
328
|
-
|
560
|
+
## 0.9.5 2016-08-16
|
561
|
+
|
329
562
|
|
330
563
|
### Fixed
|
331
564
|
|
332
565
|
- Infering multiple predicates with options works as expected ie `value(:str?, min_size?: 3, max_size?: 6)` (solnic)
|
333
566
|
- Default `locale` configured in `I18n` is now respected by the messages compiler (agustin + cavi21)
|
334
567
|
|
568
|
+
|
335
569
|
[Compare v0.9.4...v0.9.5](https://github.com/dry-rb/dry-validation/compare/v0.9.4...v0.9.5)
|
336
570
|
|
337
|
-
|
571
|
+
## 0.9.4 2016-08-11
|
572
|
+
|
338
573
|
|
339
574
|
### Fixed
|
340
575
|
|
341
576
|
- Error messages for sibling deeply nested schemas are nested correctly (timriley)
|
342
577
|
|
578
|
+
|
343
579
|
[Compare v0.9.3...v0.9.4](https://github.com/dry-rb/dry-validation/compare/v0.9.3...v0.9.4)
|
344
580
|
|
345
|
-
|
581
|
+
## 0.9.3 2016-07-22
|
582
|
+
|
346
583
|
|
347
584
|
### Added
|
348
585
|
|
@@ -360,24 +597,29 @@ Complete rewrite on top of `dry-schema`.
|
|
360
597
|
|
361
598
|
[Compare v0.9.2...v0.9.3](https://github.com/dry-rb/dry-validation/compare/v0.9.2...v0.9.3)
|
362
599
|
|
363
|
-
|
600
|
+
## 0.9.2 2016-07-13
|
601
|
+
|
364
602
|
|
365
603
|
### Fixed
|
366
604
|
|
367
605
|
- Constrained types now work with `each` macro (solnic)
|
368
606
|
- Array coercion without member type works now ie `required(:arr).maybe(:array?)` (solnic)
|
369
607
|
|
608
|
+
|
370
609
|
[Compare v0.9.1...v0.9.2](https://github.com/dry-rb/dry-validation/compare/v0.9.1...v0.9.2)
|
371
610
|
|
372
|
-
|
611
|
+
## 0.9.1 2016-07-11
|
612
|
+
|
373
613
|
|
374
614
|
### Fixed
|
375
615
|
|
376
616
|
- `I18n` backend is no longer required and set by default (solnic)
|
377
617
|
|
618
|
+
|
378
619
|
[Compare v0.9.0...v0.9.1](https://github.com/dry-rb/dry-validation/compare/v0.9.0...v0.9.1)
|
379
620
|
|
380
|
-
|
621
|
+
## 0.9.0 2016-07-08
|
622
|
+
|
381
623
|
|
382
624
|
### Added
|
383
625
|
|
@@ -390,10 +632,6 @@ Complete rewrite on top of `dry-schema`.
|
|
390
632
|
- Support for message token transformations in custom predicates (fran-worley)
|
391
633
|
- [EXPERIMENTAL] Ability to compose predicates that accept dynamic args provided by the schema (solnic)
|
392
634
|
|
393
|
-
### Changed
|
394
|
-
|
395
|
-
- Tokens for `size?` were renamed `left` => `size_left` and `right` => `size_right` (fran-worley)
|
396
|
-
|
397
635
|
### Fixed
|
398
636
|
|
399
637
|
- Duped key names in nested schemas no longer result in invalid error messages structure (solnic)
|
@@ -403,18 +641,14 @@ Complete rewrite on top of `dry-schema`.
|
|
403
641
|
- Hints for elements are no longer provided for an array when the value is not an array (solnic)
|
404
642
|
- `input` macro no longer messes up error messages for nested structures (solnic)
|
405
643
|
|
406
|
-
###
|
644
|
+
### Changed
|
407
645
|
|
408
|
-
-
|
409
|
-
- Refactored Error and Hint compilers (solnic)
|
410
|
-
- Refactored Schema to use an internal executor objects with steps (solnic)
|
411
|
-
- Extracted root-rule into a separate validation step (solnic)
|
412
|
-
- Added `MessageSet` that result objects now use (in 1.0.0 it'll be exposed via public API) (solnic)
|
413
|
-
- We can now distinguish error messages from validation hints via `Message` and `Hint` objects (solnic)
|
646
|
+
- Tokens for `size?` were renamed `left` => `size_left` and `right` => `size_right` (fran-worley)
|
414
647
|
|
415
648
|
[Compare v0.8.0...v0.9.0](https://github.com/dry-rb/dry-validation/compare/v0.8.0...v0.9.0)
|
416
649
|
|
417
|
-
|
650
|
+
## 0.8.0 2016-07-01
|
651
|
+
|
418
652
|
|
419
653
|
### Added
|
420
654
|
|
@@ -460,19 +694,10 @@ Complete rewrite on top of `dry-schema`.
|
|
460
694
|
- Deprecate key in favor of required (coop)
|
461
695
|
- Remove nested key syntax (solnic)
|
462
696
|
|
463
|
-
### Internal
|
464
|
-
|
465
|
-
- ~15% performance boost via various optimizations (solnic)
|
466
|
-
- When using explicit type specs building a schema is ~80-85x faster (solnic)
|
467
|
-
- No longer uses `Dry::Types::Predicates` as `:type?` predicate was moved to dry-logic (solnic)
|
468
|
-
- Integration specs covering predicates with Form and Schema (jodosha)
|
469
|
-
- Use latest ruby versions on travis (flash-gordon)
|
470
|
-
- Make pry console optional with IRB as a default (flash-gordon)
|
471
|
-
- Remove wrapping rules in :set nodes (solnic)
|
472
|
-
|
473
697
|
[Compare v0.7.4...v0.8.0](https://github.com/dry-rb/dry-validation/compare/v0.7.4...v0.8.0)
|
474
698
|
|
475
|
-
|
699
|
+
## 0.7.4 2016-04-06
|
700
|
+
|
476
701
|
|
477
702
|
### Added
|
478
703
|
|
@@ -483,9 +708,11 @@ Complete rewrite on top of `dry-schema`.
|
|
483
708
|
|
484
709
|
- Depending on deeply nested values in high-level rules works now (solnic)
|
485
710
|
|
711
|
+
|
486
712
|
[Compare v0.7.3...v0.7.4](https://github.com/dry-rb/dry-validation/compare/v0.7.3...v0.7.4)
|
487
713
|
|
488
|
-
|
714
|
+
## 0.7.3 2016-03-30
|
715
|
+
|
489
716
|
|
490
717
|
### Added
|
491
718
|
|
@@ -498,22 +725,22 @@ Complete rewrite on top of `dry-schema`.
|
|
498
725
|
- Creating a nested schema properly sets full path to nested data structure (solnic)
|
499
726
|
- Error message for `empty?` predicate is now correct (jodosha)
|
500
727
|
|
501
|
-
### Internal
|
502
|
-
|
503
|
-
- Switch from `thread_safe` to `concurrent` (joevandyk)
|
504
728
|
|
505
729
|
[Compare v0.7.2...v0.7.3](https://github.com/dry-rb/dry-validation/compare/v0.7.2...v0.7.3)
|
506
730
|
|
507
|
-
|
731
|
+
## 0.7.2 2016-03-28
|
732
|
+
|
508
733
|
|
509
734
|
### Added
|
510
735
|
|
511
736
|
- Support for nested schemas inside high-level rules (solnic)
|
512
737
|
- `Schema#to_proc` so that you can do `data.each(&schema)` (solnic)
|
513
738
|
|
739
|
+
|
514
740
|
[Compare v0.7.1...v0.7.2](https://github.com/dry-rb/dry-validation/compare/v0.7.1...v0.7.2)
|
515
741
|
|
516
|
-
|
742
|
+
## 0.7.1 2016-03-21
|
743
|
+
|
517
744
|
|
518
745
|
### Added
|
519
746
|
|
@@ -531,7 +758,8 @@ Complete rewrite on top of `dry-schema`.
|
|
531
758
|
|
532
759
|
[Compare v0.7.0...v0.7.1](https://github.com/dry-rb/dry-validation/compare/v0.7.0...v0.7.1)
|
533
760
|
|
534
|
-
|
761
|
+
## 0.7.0 2016-03-16
|
762
|
+
|
535
763
|
|
536
764
|
### Added
|
537
765
|
|
@@ -555,6 +783,12 @@ Complete rewrite on top of `dry-schema`.
|
|
555
783
|
- `Validation::Result` responds to `#[]` and `#each` (delegating to its output)
|
556
784
|
and it's an enumerable (solnic)
|
557
785
|
|
786
|
+
### Fixed
|
787
|
+
|
788
|
+
- Qualified rule names properly use last node by default for error messages (solnic)
|
789
|
+
- Validation hints only include relevant messages (solnic)
|
790
|
+
- `:yaml` messages respect `:locale` option in `Result#messages` (solnic)
|
791
|
+
|
558
792
|
### Changed
|
559
793
|
|
560
794
|
- `schema` was **removed** from the DSL, just use `key(:name).schema` instead (solnic)
|
@@ -565,15 +799,10 @@ Complete rewrite on top of `dry-schema`.
|
|
565
799
|
- `Schema::Result` is now `Validation::Result` and it no longer has success and
|
566
800
|
failure results, only error results are provided (solnic)
|
567
801
|
|
568
|
-
### Fixed
|
569
|
-
|
570
|
-
- Qualified rule names properly use last node by default for error messages (solnic)
|
571
|
-
- Validation hints only include relevant messages (solnic)
|
572
|
-
- `:yaml` messages respect `:locale` option in `Result#messages` (solnic)
|
573
|
-
|
574
802
|
[Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-validation/compare/v0.6.0...v0.7.0)
|
575
803
|
|
576
|
-
|
804
|
+
## 0.6.0 2016-01-20
|
805
|
+
|
577
806
|
|
578
807
|
### Added
|
579
808
|
|
@@ -584,38 +813,41 @@ Complete rewrite on top of `dry-schema`.
|
|
584
813
|
- Support for `confirmation(:foo, some_predicate: some_argument)` shortcut syntax (solnic)
|
585
814
|
- Support for error messages for grouped rules (like `confirmation`) (solnic)
|
586
815
|
- Schemas support injecting rules from the outside (solnic)
|
587
|
-
|
588
|
-
## Changed
|
589
|
-
|
816
|
+
- ## Changed
|
590
817
|
- `rule` uses objects that inherit from `BasicObject` to avoid conflicts with
|
591
818
|
predicate names and built-in `Object` methods (solnic)
|
592
819
|
- In `Schema::Form` both `key` and `optional` will apply `filled?` predicate by
|
593
820
|
default when no block is passed (solnic)
|
594
821
|
|
595
|
-
[Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-validation/compare/v0.5.0...v0.6.0)
|
596
822
|
|
597
|
-
|
823
|
+
[Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-validation/compare/v0.5.0...v0.6.0)
|
598
824
|
|
599
|
-
|
825
|
+
## 0.5.0 2016-01-11
|
600
826
|
|
601
|
-
- Now depends on [dry-logic](https://github.com/dry-rb/dry-logic) for predicates and rules (solnic)
|
602
|
-
- `dry/validation/schema/form` is now required by default (solnic)
|
603
827
|
|
604
828
|
### Fixed
|
605
829
|
|
606
830
|
- `Schema::Form` uses safe `form.array` and `form.hash` types which fixes #42 (solnic)
|
607
831
|
|
832
|
+
### Changed
|
833
|
+
|
834
|
+
- Now depends on [dry-logic](https://github.com/dry-rb/dry-logic) for predicates and rules (solnic)
|
835
|
+
- `dry/validation/schema/form` is now required by default (solnic)
|
836
|
+
|
608
837
|
[Compare v0.4.1...v0.5.0](https://github.com/dry-rb/dry-validation/compare/v0.4.1...v0.5.0)
|
609
838
|
|
610
|
-
|
839
|
+
## 0.4.1 2015-12-27
|
840
|
+
|
611
841
|
|
612
842
|
### Added
|
613
843
|
|
614
844
|
- Support for `each` and type coercion inference in `Schema::Form` (solnic)
|
615
845
|
|
846
|
+
|
616
847
|
[Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-validation/compare/v0.4.0...v0.4.1)
|
617
848
|
|
618
|
-
|
849
|
+
## 0.4.0 2015-12-21
|
850
|
+
|
619
851
|
|
620
852
|
### Added
|
621
853
|
|
@@ -629,9 +861,11 @@ Complete rewrite on top of `dry-schema`.
|
|
629
861
|
|
630
862
|
- Error messages hash has now consistent structure `rule_name => [msgs_array, input_value]` (solnic)
|
631
863
|
|
864
|
+
|
632
865
|
[Compare v0.3.1...v0.4.0](https://github.com/dry-rb/dry-validation/compare/v0.3.1...v0.4.0)
|
633
866
|
|
634
|
-
|
867
|
+
## 0.3.1 2015-12-08
|
868
|
+
|
635
869
|
|
636
870
|
### Added
|
637
871
|
|
@@ -641,9 +875,11 @@ Complete rewrite on top of `dry-schema`.
|
|
641
875
|
|
642
876
|
- Error compiler returns an empty hash rather than a nil when there are no errors (solnic)
|
643
877
|
|
878
|
+
|
644
879
|
[Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-validation/compare/v0.3.0...v0.3.1)
|
645
880
|
|
646
|
-
|
881
|
+
## 0.3.0 2015-12-07
|
882
|
+
|
647
883
|
|
648
884
|
### Added
|
649
885
|
|
@@ -665,9 +901,10 @@ Complete rewrite on top of `dry-schema`.
|
|
665
901
|
errors and messages
|
666
902
|
- `Schema::Result#messages` returns a hash with rule names, messages and input values (solnic)
|
667
903
|
|
668
|
-
[Compare v0.2.0...
|
904
|
+
[Compare v0.2.0...v0.3.0](https://github.com/dry-rb/dry-validation/compare/v0.2.0...v0.3.0)
|
905
|
+
|
906
|
+
## 0.2.0 2015-11-30
|
669
907
|
|
670
|
-
# v0.2.0 2015-11-30
|
671
908
|
|
672
909
|
### Added
|
673
910
|
|
@@ -688,8 +925,9 @@ Complete rewrite on top of `dry-schema`.
|
|
688
925
|
|
689
926
|
- Added missing `and` / `or` interfaces to composite rules (solnic)
|
690
927
|
|
691
|
-
[Compare v0.1.0...HEAD](https://github.com/dry-rb/dry-validation/compare/v0.1.0...HEAD)
|
692
928
|
|
693
|
-
|
929
|
+
[Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-validation/compare/v0.1.0...v0.2.0)
|
930
|
+
|
931
|
+
## 0.1.0 2015-11-25
|
694
932
|
|
695
933
|
First public release
|