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