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