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