dry-validation 0.13.3 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +506 -95
  3. data/LICENSE +1 -1
  4. data/README.md +16 -12
  5. data/config/errors.yml +3 -88
  6. data/dry-validation.gemspec +37 -24
  7. data/lib/dry/validation/config.rb +24 -0
  8. data/lib/dry/validation/constants.rb +43 -0
  9. data/lib/dry/validation/contract/class_interface.rb +230 -0
  10. data/lib/dry/validation/contract.rb +171 -0
  11. data/lib/dry/validation/evaluator.rb +224 -0
  12. data/lib/dry/validation/extensions/hints.rb +67 -0
  13. data/lib/dry/validation/extensions/monads.rb +24 -8
  14. data/lib/dry/validation/extensions/predicates_as_macros.rb +75 -0
  15. data/lib/dry/validation/failures.rb +70 -0
  16. data/lib/dry/validation/function.rb +44 -0
  17. data/lib/dry/validation/macro.rb +38 -0
  18. data/lib/dry/validation/macros.rb +104 -0
  19. data/lib/dry/validation/message.rb +80 -80
  20. data/lib/dry/validation/message_set.rb +80 -105
  21. data/lib/dry/validation/messages/resolver.rb +131 -0
  22. data/lib/dry/validation/result.rb +183 -41
  23. data/lib/dry/validation/rule.rb +135 -0
  24. data/lib/dry/validation/schema_ext.rb +19 -0
  25. data/lib/dry/validation/values.rb +104 -0
  26. data/lib/dry/validation/version.rb +3 -1
  27. data/lib/dry/validation.rb +45 -28
  28. data/lib/dry-validation.rb +3 -1
  29. metadata +46 -344
  30. data/.codeclimate.yml +0 -17
  31. data/.gitignore +0 -9
  32. data/.rspec +0 -3
  33. data/.travis.yml +0 -29
  34. data/CONTRIBUTING.md +0 -31
  35. data/Gemfile +0 -25
  36. data/Rakefile +0 -22
  37. data/benchmarks/benchmark_form_invalid.rb +0 -64
  38. data/benchmarks/benchmark_form_valid.rb +0 -64
  39. data/benchmarks/benchmark_schema_invalid_huge.rb +0 -52
  40. data/benchmarks/profile_schema_call_invalid.rb +0 -20
  41. data/benchmarks/profile_schema_call_valid.rb +0 -20
  42. data/benchmarks/profile_schema_definition.rb +0 -14
  43. data/benchmarks/profile_schema_huge_invalid.rb +0 -30
  44. data/benchmarks/profile_schema_messages_invalid.rb +0 -20
  45. data/benchmarks/suite.rb +0 -5
  46. data/examples/basic.rb +0 -15
  47. data/examples/each.rb +0 -14
  48. data/examples/json.rb +0 -12
  49. data/examples/multiple.rb +0 -27
  50. data/examples/nested.rb +0 -22
  51. data/examples/params.rb +0 -11
  52. data/lib/dry/validation/compat/form.rb +0 -67
  53. data/lib/dry/validation/deprecations.rb +0 -24
  54. data/lib/dry/validation/executor.rb +0 -91
  55. data/lib/dry/validation/extensions/struct.rb +0 -32
  56. data/lib/dry/validation/extensions.rb +0 -7
  57. data/lib/dry/validation/input_processor_compiler/json.rb +0 -45
  58. data/lib/dry/validation/input_processor_compiler/params.rb +0 -49
  59. data/lib/dry/validation/input_processor_compiler/sanitizer.rb +0 -47
  60. data/lib/dry/validation/input_processor_compiler.rb +0 -137
  61. data/lib/dry/validation/message_compiler/visitor_opts.rb +0 -37
  62. data/lib/dry/validation/message_compiler.rb +0 -188
  63. data/lib/dry/validation/messages/abstract.rb +0 -119
  64. data/lib/dry/validation/messages/i18n.rb +0 -47
  65. data/lib/dry/validation/messages/namespaced.rb +0 -39
  66. data/lib/dry/validation/messages/yaml.rb +0 -61
  67. data/lib/dry/validation/messages.rb +0 -14
  68. data/lib/dry/validation/predicate_registry.rb +0 -115
  69. data/lib/dry/validation/predicates.rb +0 -19
  70. data/lib/dry/validation/schema/check.rb +0 -37
  71. data/lib/dry/validation/schema/class_interface.rb +0 -190
  72. data/lib/dry/validation/schema/deprecated.rb +0 -30
  73. data/lib/dry/validation/schema/dsl.rb +0 -118
  74. data/lib/dry/validation/schema/form.rb +0 -9
  75. data/lib/dry/validation/schema/json.rb +0 -21
  76. data/lib/dry/validation/schema/key.rb +0 -71
  77. data/lib/dry/validation/schema/params.rb +0 -22
  78. data/lib/dry/validation/schema/rule.rb +0 -202
  79. data/lib/dry/validation/schema/value.rb +0 -211
  80. data/lib/dry/validation/schema.rb +0 -126
  81. data/lib/dry/validation/schema_compiler.rb +0 -81
  82. data/lib/dry/validation/template.rb +0 -66
  83. data/lib/dry/validation/type_specs.rb +0 -70
  84. data/log/.gitkeep +0 -0
  85. data/spec/extensions/monads/result_spec.rb +0 -40
  86. data/spec/extensions/struct/schema_spec.rb +0 -32
  87. data/spec/fixtures/locales/en.yml +0 -8
  88. data/spec/fixtures/locales/pl.yml +0 -22
  89. data/spec/integration/custom_error_messages_spec.rb +0 -54
  90. data/spec/integration/custom_predicates_spec.rb +0 -228
  91. data/spec/integration/hints_spec.rb +0 -170
  92. data/spec/integration/injecting_rules_spec.rb +0 -30
  93. data/spec/integration/json/defining_base_schema_spec.rb +0 -41
  94. data/spec/integration/localized_error_messages_spec.rb +0 -72
  95. data/spec/integration/message_compiler_spec.rb +0 -405
  96. data/spec/integration/messages/i18n_spec.rb +0 -104
  97. data/spec/integration/optional_keys_spec.rb +0 -28
  98. data/spec/integration/params/predicates/array_spec.rb +0 -287
  99. data/spec/integration/params/predicates/empty_spec.rb +0 -263
  100. data/spec/integration/params/predicates/eql_spec.rb +0 -327
  101. data/spec/integration/params/predicates/even_spec.rb +0 -455
  102. data/spec/integration/params/predicates/excluded_from_spec.rb +0 -455
  103. data/spec/integration/params/predicates/excludes_spec.rb +0 -391
  104. data/spec/integration/params/predicates/false_spec.rb +0 -455
  105. data/spec/integration/params/predicates/filled_spec.rb +0 -467
  106. data/spec/integration/params/predicates/format_spec.rb +0 -454
  107. data/spec/integration/params/predicates/gt_spec.rb +0 -519
  108. data/spec/integration/params/predicates/gteq_spec.rb +0 -519
  109. data/spec/integration/params/predicates/included_in_spec.rb +0 -455
  110. data/spec/integration/params/predicates/includes_spec.rb +0 -391
  111. data/spec/integration/params/predicates/key_spec.rb +0 -67
  112. data/spec/integration/params/predicates/lt_spec.rb +0 -519
  113. data/spec/integration/params/predicates/lteq_spec.rb +0 -519
  114. data/spec/integration/params/predicates/max_size_spec.rb +0 -391
  115. data/spec/integration/params/predicates/min_size_spec.rb +0 -391
  116. data/spec/integration/params/predicates/none_spec.rb +0 -265
  117. data/spec/integration/params/predicates/not_eql_spec.rb +0 -327
  118. data/spec/integration/params/predicates/odd_spec.rb +0 -455
  119. data/spec/integration/params/predicates/size/fixed_spec.rb +0 -393
  120. data/spec/integration/params/predicates/size/range_spec.rb +0 -396
  121. data/spec/integration/params/predicates/true_spec.rb +0 -455
  122. data/spec/integration/params/predicates/type_spec.rb +0 -391
  123. data/spec/integration/result_spec.rb +0 -81
  124. data/spec/integration/schema/array_schema_spec.rb +0 -59
  125. data/spec/integration/schema/check_rules_spec.rb +0 -119
  126. data/spec/integration/schema/check_with_nested_el_spec.rb +0 -37
  127. data/spec/integration/schema/check_with_nth_el_spec.rb +0 -25
  128. data/spec/integration/schema/default_settings_spec.rb +0 -11
  129. data/spec/integration/schema/defining_base_schema_spec.rb +0 -41
  130. data/spec/integration/schema/dynamic_predicate_args_spec.rb +0 -43
  131. data/spec/integration/schema/each_with_set_spec.rb +0 -70
  132. data/spec/integration/schema/extending_dsl_spec.rb +0 -27
  133. data/spec/integration/schema/form_spec.rb +0 -236
  134. data/spec/integration/schema/hash_schema_spec.rb +0 -47
  135. data/spec/integration/schema/inheriting_schema_spec.rb +0 -31
  136. data/spec/integration/schema/input_processor_spec.rb +0 -46
  137. data/spec/integration/schema/json/explicit_types_spec.rb +0 -157
  138. data/spec/integration/schema/json_spec.rb +0 -163
  139. data/spec/integration/schema/macros/confirmation_spec.rb +0 -35
  140. data/spec/integration/schema/macros/each_spec.rb +0 -268
  141. data/spec/integration/schema/macros/filled_spec.rb +0 -87
  142. data/spec/integration/schema/macros/input_spec.rb +0 -139
  143. data/spec/integration/schema/macros/maybe_spec.rb +0 -99
  144. data/spec/integration/schema/macros/rule_spec.rb +0 -75
  145. data/spec/integration/schema/macros/value_spec.rb +0 -119
  146. data/spec/integration/schema/macros/when_spec.rb +0 -62
  147. data/spec/integration/schema/nested_schemas_spec.rb +0 -236
  148. data/spec/integration/schema/nested_values_spec.rb +0 -46
  149. data/spec/integration/schema/not_spec.rb +0 -34
  150. data/spec/integration/schema/numbers_spec.rb +0 -19
  151. data/spec/integration/schema/option_with_default_spec.rb +0 -64
  152. data/spec/integration/schema/or_spec.rb +0 -87
  153. data/spec/integration/schema/params/defining_base_schema_spec.rb +0 -41
  154. data/spec/integration/schema/params/explicit_types_spec.rb +0 -195
  155. data/spec/integration/schema/params_spec.rb +0 -234
  156. data/spec/integration/schema/predicate_verification_spec.rb +0 -9
  157. data/spec/integration/schema/predicates/array_spec.rb +0 -295
  158. data/spec/integration/schema/predicates/custom_spec.rb +0 -103
  159. data/spec/integration/schema/predicates/empty_spec.rb +0 -263
  160. data/spec/integration/schema/predicates/eql_spec.rb +0 -327
  161. data/spec/integration/schema/predicates/even_spec.rb +0 -455
  162. data/spec/integration/schema/predicates/excluded_from/array_spec.rb +0 -459
  163. data/spec/integration/schema/predicates/excluded_from/range_spec.rb +0 -459
  164. data/spec/integration/schema/predicates/excludes_spec.rb +0 -391
  165. data/spec/integration/schema/predicates/filled_spec.rb +0 -467
  166. data/spec/integration/schema/predicates/format_spec.rb +0 -455
  167. data/spec/integration/schema/predicates/gt_spec.rb +0 -519
  168. data/spec/integration/schema/predicates/gteq_spec.rb +0 -519
  169. data/spec/integration/schema/predicates/hash_spec.rb +0 -69
  170. data/spec/integration/schema/predicates/included_in/array_spec.rb +0 -459
  171. data/spec/integration/schema/predicates/included_in/range_spec.rb +0 -459
  172. data/spec/integration/schema/predicates/includes_spec.rb +0 -391
  173. data/spec/integration/schema/predicates/key_spec.rb +0 -88
  174. data/spec/integration/schema/predicates/lt_spec.rb +0 -520
  175. data/spec/integration/schema/predicates/lteq_spec.rb +0 -519
  176. data/spec/integration/schema/predicates/max_size_spec.rb +0 -391
  177. data/spec/integration/schema/predicates/min_size_spec.rb +0 -391
  178. data/spec/integration/schema/predicates/none_spec.rb +0 -265
  179. data/spec/integration/schema/predicates/not_eql_spec.rb +0 -391
  180. data/spec/integration/schema/predicates/odd_spec.rb +0 -455
  181. data/spec/integration/schema/predicates/size/fixed_spec.rb +0 -398
  182. data/spec/integration/schema/predicates/size/range_spec.rb +0 -395
  183. data/spec/integration/schema/predicates/type_spec.rb +0 -413
  184. data/spec/integration/schema/reusing_schema_spec.rb +0 -33
  185. data/spec/integration/schema/using_types_spec.rb +0 -135
  186. data/spec/integration/schema/validate_spec.rb +0 -120
  187. data/spec/integration/schema/xor_spec.rb +0 -35
  188. data/spec/integration/schema_builders_spec.rb +0 -17
  189. data/spec/integration/schema_spec.rb +0 -173
  190. data/spec/shared/message_compiler.rb +0 -11
  191. data/spec/shared/predicate_helper.rb +0 -15
  192. data/spec/shared/rule_compiler.rb +0 -8
  193. data/spec/spec_helper.rb +0 -62
  194. data/spec/support/define_struct.rb +0 -25
  195. data/spec/support/matchers.rb +0 -38
  196. data/spec/support/mutant.rb +0 -9
  197. data/spec/support/predicates_integration.rb +0 -7
  198. data/spec/unit/input_processor_compiler/json_spec.rb +0 -283
  199. data/spec/unit/input_processor_compiler/params_spec.rb +0 -328
  200. data/spec/unit/message_compiler/visit_failure_spec.rb +0 -38
  201. data/spec/unit/message_compiler/visit_spec.rb +0 -16
  202. data/spec/unit/message_compiler_spec.rb +0 -7
  203. data/spec/unit/predicate_registry_spec.rb +0 -34
  204. data/spec/unit/schema/key_spec.rb +0 -38
  205. data/spec/unit/schema/rule_spec.rb +0 -42
  206. data/spec/unit/schema/value_spec.rb +0 -131
  207. data/spec/unit/schema_spec.rb +0 -35
data/CHANGELOG.md CHANGED
@@ -1,62 +1,459 @@
1
- # v0.13.3 2019-05-21
1
+ <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
+
3
+ ## 1.7.0 2021-09-12
4
+
5
+
6
+ ### Changed
7
+
8
+ - [internal] Upgraded to new `setting` API provided in dry-configurable 0.13.0 (@timriley in #686 and 3f8f7d8)
9
+ - Bumped dry-schema dependency to 1.8.0 (in part, to ensure dry-configurable 0.13.0 is available) (@timriley)
10
+
11
+ [Compare v1.6.0...v1.7.0](https://github.com/dry-rb/dry-validation/compare/v1.6.0...v1.7.0)
12
+
13
+ ## 1.6.0 2020-12-05
14
+
15
+
16
+ ### Added
17
+
18
+ - You can now pass a key name or path to `rule_error?` predicate (issue #658 closed via #673) (@moofkit)
19
+ - You can now pass initial context object to `Contract#call` (issue #674 via #675) (@pyromaniac)
20
+
21
+ ### Fixed
22
+
23
+ - Checking `key?` within a rule no longer crashes when value is `nil` or an empty string (issue #670 fixed via #672) (@alexxty7)
24
+
25
+
26
+ [Compare v1.5.6...v1.6.0](https://github.com/dry-rb/dry-validation/compare/v1.5.6...v1.6.0)
27
+
28
+ ## 1.5.6 2020-09-04
29
+
30
+
31
+ ### Fixed
32
+
33
+ - Dependency on dry-schema was bumped to >= 1.5.1. This time for real (@solnic)
34
+
35
+
36
+ [Compare v1.5.5...v1.5.6](https://github.com/dry-rb/dry-validation/compare/v1.5.5...v1.5.6)
37
+
38
+ ## 1.5.5 2020-09-03
39
+
40
+
41
+ ### Fixed
42
+
43
+ - Dependency on dry-schema was bumped to >= 1.5.2 (see #666 for more info) (@artofhuman)
44
+
45
+
46
+ [Compare v1.5.4...v1.5.5](https://github.com/dry-rb/dry-validation/compare/v1.5.4...v1.5.5)
47
+
48
+ ## 1.5.4 2020-08-21
49
+
50
+
51
+ ### Added
52
+
53
+ - You can now pass any key or a path to the rule's `key?` helper (see #664 for more info) (@alassek)
54
+
55
+ ### Fixed
56
+
57
+ - Full messages work correctly with rule failures now (issue #661 fixed via #662) (@stind)
58
+ - Providing a custom message template for array errors works correctly (issue #663 fixed via #665) (@tadeusz-niemiec)
59
+
60
+
61
+ [Compare v1.5.3...v1.5.4](https://github.com/dry-rb/dry-validation/compare/v1.5.3...v1.5.4)
62
+
63
+ ## 1.5.3 2020-07-27
64
+
65
+
66
+ ### Added
67
+
68
+ - You can now access current value's index via `rule(:foo).each do |index:|` (issue #606 done via #657) (@mrbongiolo)
69
+
70
+ ### Fixed
71
+
72
+ - Using `.each(:foo)` works as expected when there are errors related to other keys (issue #659 fixed via #660) (@solnic)
73
+
74
+ ### Changed
75
+
76
+ - `Result#error?` is now a public API and it takes into consideration both schema and rule errors (issue #655 fixed via #656) (@PragTob)
77
+
78
+ [Compare v1.5.2...v1.5.3](https://github.com/dry-rb/dry-validation/compare/v1.5.2...v1.5.3)
79
+
80
+ ## 1.5.2 2020-07-14
81
+
82
+
83
+ ### Fixed
84
+
85
+ - `key?` predicate in rules no longer crashes when the rule path points to a non-existent array value (issue #653 fixed via #654) (@solnic)
86
+
87
+
88
+ [Compare v1.5.1...v1.5.2](https://github.com/dry-rb/dry-validation/compare/v1.5.1...v1.5.2)
89
+
90
+ ## 1.5.1 2020-06-18
91
+
92
+
93
+ ### Fixed
94
+
95
+ - dry-monads no longer required for the `:hints` extension (@schokomarie)
96
+ - Using `full: true` option works as expected with custom rule messages (issue #618 fixed via #651) (@sirfilip)
97
+ - Using `locale: ...` option works as expected with hints (issue #589 fixed via 652) (@sirfilip)
98
+
99
+
100
+ [Compare v1.5.0...v1.5.1](https://github.com/dry-rb/dry-validation/compare/v1.5.0...v1.5.1)
101
+
102
+ ## 1.5.0 2020-03-11
103
+
104
+
105
+ ### Added
106
+
107
+ - `schema_error?` rule helper (@waiting-for-dev)
108
+ - `rule_error?` rule helper (@waiting-for-dev)
109
+
110
+ ### Changed
111
+
112
+ - dry-schema dependency was bumped to `~> 1.5` (@solnic)
113
+ - [internal] `KeyMap` patches have been removed since dry-schema now provides required functionality (@solnic)
114
+
115
+ [Compare v1.4.2...v1.5.0](https://github.com/dry-rb/dry-validation/compare/v1.4.2...v1.5.0)
116
+
117
+ ## 1.4.2 2020-01-18
118
+
119
+
120
+ ### Fixed
121
+
122
+ - Macros using predicates that accept a range argument work as expected (no need to wrap the argument in an array) (@waiting-for-dev)
123
+
124
+
125
+ [Compare v1.4.1...v1.4.2](https://github.com/dry-rb/dry-validation/compare/v1.4.1...v1.4.2)
126
+
127
+ ## 1.4.1 2020-01-08
128
+
129
+
130
+ ### Added
131
+
132
+ - Pattern matching on result values (@flash-gordon)
2
133
 
3
134
  ### Fixed
4
135
 
5
- * Fixed regression with caching templates that rely on predicate arguments (solnic)
6
- * Removed ugly workaround for template evaluation with extra tokens (solnic)
136
+ - List tokens are correctly interpolated as a comma separated list in rule messages (see #611) (@waiting-for-dev)
137
+ - Warnings about delegated keywords (@flash-gordon)
138
+
139
+
140
+ [Compare v1.4.0...v1.4.1](https://github.com/dry-rb/dry-validation/compare/v1.4.0...v1.4.1)
141
+
142
+ ## 1.4.0 2019-12-12
143
+
144
+
145
+ ### Added
146
+
147
+ - Support for multi-schema inheritance (@ianwhite)
148
+
149
+ ### Fixed
150
+
151
+ - Keyword warnings reported by Ruby 2.7 (@flash-gordon)
152
+ - Fixed an issue where `MessageSet` would be marked as empty too early (@ianwhite)
153
+ - Messages are correctly generated when there are errors for both an array and one or more of its elements (see #599) (@Bugagazavr)
7
154
 
8
155
  ### Changed
9
156
 
10
- * [internal] `Messages::Abstract#call` returns a `Template` object now, this was backported from dry-schema (solnic)
157
+ - A meaningful exception is raised when failure options are not valid (@MatElGran)
158
+ - [internal] improved performance in `Contract.ensure_valid_keys` (@grzegorz-jakubiak)
159
+ - [internal] fixed keyword warnings on MRI 2.7.0 (@flash-gordon)
160
+
161
+ [Compare v1.3.1...v1.4.0](https://github.com/dry-rb/dry-validation/compare/v1.3.1...v1.4.0)
162
+
163
+ ## 1.3.1 2019-08-16
164
+
165
+
166
+ ### Changed
11
167
 
12
- [Compare v0.13.2...v0.13.3](https://github.com/dry-rb/dry-validation/compare/v0.13.2...v0.13.3)
168
+ - You can now set an external schema without providing a block (@alassek)
169
+
170
+ [Compare v1.3.0...v1.3.1](https://github.com/dry-rb/dry-validation/compare/v1.3.0...v1.3.1)
171
+
172
+ ## 1.3.0 2019-08-14
173
+
174
+
175
+ ### Added
176
+
177
+ - Support for setting an external schema (that can be extended too) (fixed #574) (@solnic)
178
+
179
+ ### Fixed
180
+
181
+ - Using a hash spec to define rule keys with more than one value is properly handled by rule guard now (fixed #576) (@solnic)
182
+
183
+ ### Changed
184
+
185
+ - `values` within rules uses `Hash#fetch_values` internally now, which improves performance (@esparta)
186
+
187
+ [Compare v1.2.1...v1.3.0](https://github.com/dry-rb/dry-validation/compare/v1.2.1...v1.3.0)
188
+
189
+ ## 1.2.1 2019-07-16
13
190
 
14
- # v0.13.2 2019-05-12
15
191
 
16
192
  ### Fixed
17
193
 
18
- * Caching message templates uses restricted set of known keys to calculate cache keys (solnic)
194
+ - Defining an abstract contract class that has no schema no longer crashes (issue #565) (@solnic)
195
+ - Fixed an issue where `Rule#each` would crash when the value is not an array (issue #567) (@solnic)
196
+ - Fixed an issue where guarding a rule would crash when keys are missing in the input (issue #569) (@solnic)
197
+ - Added missing "pathname" require (issue #570) (@solnic)
198
+
19
199
 
20
- [Compare v0.13.1...v0.13.2](https://github.com/dry-rb/dry-validation/compare/v0.13.1...v0.13.2)
200
+ [Compare v1.2.0...v1.2.1](https://github.com/dry-rb/dry-validation/compare/v1.2.0...v1.2.1)
21
201
 
22
- # v0.13.1 2019-03-22
202
+ ## 1.2.0 2019-07-08
203
+
204
+
205
+ ### Added
206
+
207
+ - New extension `:predicates_as_macros` (@waiting-for-dev)
208
+
209
+ ### Fixed
210
+
211
+ - Guarding rules for nested keys works correctly (issue #560) (@solnic)
23
212
 
24
213
  ### Changed
25
214
 
26
- - `dry-types` was locked to `~> 0.14.0` (flash-gordon)
215
+ - `dry-schema` dependency was bumped to `>= 1.3.1` (@solnic)
216
+
217
+ [Compare v1.1.1...v1.2.0](https://github.com/dry-rb/dry-validation/compare/v1.1.1...v1.2.0)
218
+
219
+ ## 1.1.1 2019-06-24
220
+
221
+
222
+ ### Fixed
223
+
224
+ - `Rule#each` works with array values from nested hashes (@mustardnoise)
225
+
226
+
227
+ [Compare v1.1.0...v1.1.1](https://github.com/dry-rb/dry-validation/compare/v1.1.0...v1.1.1)
228
+
229
+ ## 1.1.0 2019-06-14
230
+
231
+
232
+ ### Added
233
+
234
+ - `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)
235
+ - `value` supports hash-based path specifications now (refs #547) (@solnic)
236
+ - `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)
237
+
238
+ ### Fixed
239
+
240
+ - Passing multiple macro names to `validate` or `each` works correctly (fixed #538 #541) (@jandudulski)
241
+
242
+
243
+ [Compare v1.0.0...v1.1.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0...v1.1.0)
27
244
 
28
- [Compare v0.13.0...v0.13.1](https://github.com/dry-rb/dry-validation/compare/v0.13.0...v0.13.1)
245
+ ## 1.0.0 2019-06-10
29
246
 
30
- # v0.13.0 2019-01-29
247
+ 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).
248
+
249
+
250
+ [Compare v1.0.0...v1.0.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0...v1.0.0)
251
+
252
+ ## 1.0.0 2019-06-10
253
+
254
+
255
+ ### Added
256
+
257
+ - Support for defining rules for each element of an array via `rule(:items).each { ... }` (solnic)
258
+ - Support for parameterized macros via `rule(:foo).validate(my_macro: :some_option)` (solnic)
259
+ - `values#[]` is now compatible with path specs (symbol, array with keys or dot-notation) (issue #528) (solnic)
260
+ - `value` shortcut for accessing the value found under the first key specified by a rule. ie `rule(:foo) { value }` returns `values[:foo]` (solnic)
261
+
262
+ ### Fixed
263
+
264
+ - Contract's `config.locale` option was replaced by `config.messages.default_locale` to avoid conflicts with run-time `:locale` option and/or whatever is set via `I18n` gem (solnic)
265
+ - Macros no longer mutate `Dry::Validation::Contract.macros` when using inheritance (solnic)
266
+ - Missing dependency on `dry-container` was added (solnic)
31
267
 
32
268
  ### Changed
33
269
 
34
- - `dry-logic` was bumped to `~> 0.5` (solnic)
35
- - `dry-types` was bumped to `~> 0.14` (solnic)
270
+ - `rule` will raise `InvalidKeysError` when specified keys are not defined by the schema (solnic)
271
+ - `Contract.new` will raise `SchemaMissingError` when the class doesn't have schema defined (solnic)
272
+ - Contracts no longer support `:locale` option in the constructor. Use `Result#errors(locale: :pl)` to change locale at run-time (solnic)
273
+
274
+ [Compare v1.0.0.rc3...v1.0.0](https://github.com/dry-rb/dry-validation/compare/v1.0.0.rc3...v1.0.0)
275
+
276
+ ## 1.0.0.rc3 2019-05-06
277
+
278
+
279
+ ### Added
280
+
281
+ - [EXPERIMENTAL] `Validation.register_macro` for registering global macros (solnic)
282
+ - [EXPERIMENTAL] `Contract.register_macro` for registering macros available to specific contract classes (solnic)
283
+ - `Dry::Validation.Contract` shortcut for quickly defining a contract and getting its instance back (solnic)
284
+ - New configuration option `config.locale` for setting the default locale (solnic)
285
+
286
+ ### Fixed
287
+
288
+ - `config/errors.yml` are now bundled with the gem, **`rc2` was broken because of this** (solnic)
289
+
290
+
291
+ [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)
292
+
293
+ ## 1.0.0.rc2 2019-05-04
294
+
295
+ 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`.
296
+
297
+ ### Added
298
+
299
+ - [EXPERIMENTAL] support for registering macros via `Dry::Validation::Macros.register(:your_macro, &block)` (solnic)
300
+ - [EXPERIMENTAL] `:acceptance` as the first built-in macro (issue #157) (solnic)
301
+
302
+ ### Fixed
303
+
304
+ - Passing invalid argument to `failure` will raise a meaningful error instead of crashing (solnic)
305
+
306
+ ### Changed
307
+
308
+ - 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)
309
+ - Dependency on `dry-schema` was updated to `~> 1.0` (solnic)
310
+
311
+ [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)
312
+
313
+ ## 1.0.0.rc1 2019-04-26
314
+
315
+
316
+ ### Added
317
+
318
+ - `:hints` extension is back (solnic)
319
+ - `Result` objects have access to the context object which is shared between rules (flash-gordon)
320
+
321
+ ### Fixed
322
+
323
+ - Multiple hint messages no longer crash message set (flash-gordon)
324
+ - `Contract#inspect` no longer crashes (solnic)
325
+
326
+ ### Changed
327
+
328
+ - Dependency on `dry-schema` was bumped to `~> 0.6` - this pulls in `dry-types 1.0.0` and `dry-logic 1.0.0` (solnic)
329
+ - Dependency on `dry-initializer` was bumped to `~> 3.0` (solnic)
330
+
331
+ [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)
332
+
333
+ ## 1.0.0.beta2 2019-04-04
334
+
335
+
336
+ ### Added
337
+
338
+ - Support for arbitrary meta-data in failures, ie:
339
+
340
+ ```ruby
341
+ class NewUserContract < Dry::Validation::Contract
342
+ params do
343
+ required(:login).filled(:string)
344
+ end
345
+
346
+ rule(:login) do
347
+ key.failure(text: 'is taken', code: 123) unless db.unique?(values[:login])
348
+ end
349
+ end
350
+ ```
351
+
352
+ Now your error hash will include `{ login: [{ text: 'is taken', code: 123 }] }` (solnic + flash-gordon)
353
+
354
+ ### Changed
355
+
356
+ - [BREAKING] `Error` was renamed to `Message` as it is a more generic concept (solnic)
357
+ - [BREAKING] `ErrorSet` was renamed to `MessageSet` for consistency (solnic)
358
+ - [BREAKING] `:monads` extension wraps entire result objects in `Success` or `Failure` (flash-gordon)
359
+
360
+ [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)
361
+
362
+ ## 1.0.0.beta1 2019-03-26
363
+
364
+
365
+ ### Added
366
+
367
+ - New API for setting failures `base.failure` for base errors and `key.failure` for key errors (solnic)
368
+ - Support for `base` errors associated with a key even when child keys have errors too (solnic)
369
+ - Support for `base` errors not associated with any key (solnic)
370
+ - Result objects use `ErrorSet` object now for managing messages (solnic)
371
+ - Nested keys are properly handled when generating messages hash (issue #489) (flash-gordon + solnic)
372
+ - Result objects support `locale` and `full` options now (solnic)
373
+ - Ability to configure `top_namespace` for messages, which will be used for both schema and rule localization (solnic)
374
+ - Rule blocks receive a context object that you can use to share data between rules (solnic)
375
+
376
+ ### Changed
377
+
378
+ - [BREAKING] `Result#errors` returns an instance of `ErrorSet` now, it's an enumerable, coerible to a hash (solnic)
379
+ - [BREAKING] `failure` was removed in favor of `key.failure` or `key(:foo).failure` (solnic)
380
+ - [BREAKING] `Result#to_hash` was removed (flash-gordon)
381
+
382
+ [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)
383
+
384
+ ## 1.0.0.alpha2 2019-03-05
385
+
386
+ First round of bug fixes. Thanks for testing <3!
387
+
388
+ ### Fixed
389
+
390
+ - Errors with nested messages are correctly built (flash-gordon)
391
+ - Messages for nested keys are correctly resolved (solnic)
392
+ - 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)
393
+
394
+ ### Changed
395
+
396
+ - When a message template is not found a more meaningful error is raised that includes both rule identifier and key path (solnic)
397
+
398
+ [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)
399
+
400
+ ## 1.0.0.alpha1 2019-03-04
401
+
402
+ Complete rewrite on top of `dry-schema`.
403
+
404
+ ### Added
405
+
406
+ - [BREAKING] `Dry::Validation::Contract` as a replacement for validation schemas (solnic)
407
+ - [BREAKING] New `rule` DSL with an improved API for setting error messages (solnic)
408
+
409
+
410
+ [Compare v0.13.0...v1.0.0.alpha1](https://github.com/dry-rb/dry-validation/compare/v0.13.0...v1.0.0.alpha1)
411
+
412
+ ## 0.13.0 2019-01-29
413
+
36
414
 
37
415
  ### Fixed
38
416
 
39
417
  - Warning about method redefined (amatsuda)
40
418
 
41
- [Compare v0.12.2...v0.13.0](https://github.com/dry-rb/dry-validation/compare/v0.12.2...v0.13.0)
419
+ ### Changed
420
+
421
+ - `dry-logic` was bumped to `~> 0.5` (solnic)
422
+ - `dry-types` was bumped to `~> 0.14` (solnic)
423
+
424
+ [Compare v0.12.3...v0.13.0](https://github.com/dry-rb/dry-validation/compare/v0.12.3...v0.13.0)
425
+
426
+ ## 0.12.3 2019-01-29
427
+
428
+
429
+ ### Changed
430
+
431
+ - [internal] dry-logic was pinned to `~> 0.4.2` (flash-gordon)
432
+
433
+ [Compare v0.12.2...v0.12.3](https://github.com/dry-rb/dry-validation/compare/v0.12.2...v0.12.3)
434
+
435
+ ## 0.12.2 2018-08-29
42
436
 
43
- # v0.12.2 2018-08-29
44
437
 
45
438
  ### Fixed
46
439
 
47
440
  - Use correct key names for rule messages when using i18n (jozzi05)
48
441
 
442
+
49
443
  [Compare v0.12.1...v0.12.2](https://github.com/dry-rb/dry-validation/compare/v0.12.1...v0.12.2)
50
444
 
51
- # v0.12.1 2018-07-06
445
+ ## 0.12.1 2018-07-06
446
+
52
447
 
53
448
  ### Fixed
54
449
 
55
450
  - [internal] fixed deprecation warnings (flash-gordon)
56
451
 
452
+
57
453
  [Compare v0.12.0...v0.12.1](https://github.com/dry-rb/dry-validation/compare/v0.12.0...v0.12.1)
58
454
 
59
- # v0.12.0 2018-05-31
455
+ ## 0.12.0 2018-05-31
456
+
60
457
 
61
458
  ### Changed
62
459
 
@@ -65,7 +462,8 @@
65
462
 
66
463
  [Compare v0.11.1...v0.12.0](https://github.com/dry-rb/dry-validation/compare/v0.11.1...v0.12.0)
67
464
 
68
- # v0.11.1 2017-09-15
465
+ ## 0.11.1 2017-09-15
466
+
69
467
 
70
468
  ### Changed
71
469
 
@@ -74,7 +472,8 @@
74
472
 
75
473
  [Compare v0.11.0...v0.11.1](https://github.com/dry-rb/dry-validation/compare/v0.11.0...v0.11.1)
76
474
 
77
- # v0.11.0 2017-05-30
475
+ ## 0.11.0 2017-05-30
476
+
78
477
 
79
478
  ### Changed
80
479
 
@@ -82,32 +481,39 @@
82
481
 
83
482
  [Compare v0.10.7...v0.11.0](https://github.com/dry-rb/dry-validation/compare/v0.10.7...v0.11.0)
84
483
 
85
- # v0.10.7 2017-05-15
484
+ ## 0.10.7 2017-05-15
485
+
86
486
 
87
487
  ### Fixed
88
488
 
89
489
  - `validate` can now be defined multiple times for the same key (kimquy)
90
490
  - Re-using rules between schemas no longer mutates original rule set (pabloh)
91
491
 
492
+
92
493
  [Compare v0.10.6...v0.10.7](https://github.com/dry-rb/dry-validation/compare/v0.10.6...v0.10.7)
93
494
 
94
- # v0.10.6 2017-04-26
495
+ ## 0.10.6 2017-04-26
496
+
95
497
 
96
498
  ### Fixed
97
499
 
98
500
  - Fixes issue with wrong localized error messages when namespaced messages are used (kbredemeier)
99
501
 
502
+
100
503
  [Compare v0.10.5...v0.10.6](https://github.com/dry-rb/dry-validation/compare/v0.10.5...v0.10.6)
101
504
 
102
- # v0.10.5 2017-01-12
505
+ ## 0.10.5 2017-01-12
506
+
103
507
 
104
508
  ### Fixed
105
509
 
106
510
  - Warnings under MRI 2.4.0 are gone (koic)
107
511
 
512
+
108
513
  [Compare v0.10.4...v0.10.5](https://github.com/dry-rb/dry-validation/compare/v0.10.4...v0.10.5)
109
514
 
110
- # v0.10.4 2016-12-03
515
+ ## 0.10.4 2016-12-03
516
+
111
517
 
112
518
  ### Fixed
113
519
 
@@ -120,31 +526,38 @@
120
526
 
121
527
  [Compare v0.10.3...v0.10.4](https://github.com/dry-rb/dry-validation/compare/v0.10.3...v0.10.4)
122
528
 
123
- # v0.10.3 2016-09-27
529
+ ## 0.10.3 2016-09-27
530
+
124
531
 
125
532
  ### Fixed
126
533
 
127
534
  - Custom predicates work correctly with `each` macro (solnic)
128
535
 
536
+
129
537
  [Compare v0.10.2...v0.10.3](https://github.com/dry-rb/dry-validation/compare/v0.10.2...v0.10.3)
130
538
 
131
- # v0.10.2 2016-09-23
539
+ ## 0.10.2 2016-09-23
540
+
132
541
 
133
542
  ### Fixed
134
543
 
135
544
  - Constrained types + hints work again (solnic)
136
545
 
546
+
137
547
  [Compare v0.10.1...v0.10.2](https://github.com/dry-rb/dry-validation/compare/v0.10.1...v0.10.2)
138
548
 
139
- # v0.10.1 2016-09-22
549
+ ## 0.10.1 2016-09-22
550
+
140
551
 
141
552
  ### Fixed
142
553
 
143
554
  - Remove obsolete require of `dry/struct` which is now an optional extension (flash-gordon)
144
555
 
556
+
145
557
  [Compare v0.10.0...v0.10.1](https://github.com/dry-rb/dry-validation/compare/v0.10.0...v0.10.1)
146
558
 
147
- # v0.10.0 2016-09-21
559
+ ## 0.10.0 2016-09-21
560
+
148
561
 
149
562
  ### Added
150
563
 
@@ -167,34 +580,31 @@
167
580
  - [BREAKING] `when` macro no longer supports multiple disconnected rules in its block, whatever the block returns will be used for the implication (solnic)
168
581
  - [BREAKING] `rule(some_name: %i(some keys))` will _always_ use `:some_name` as the key for failure messages (solnic)
169
582
 
170
- ### Internal
171
-
172
- - ~2 x performance boost (solnic)
173
- - Rule AST was updated to latest dry-logic (solnic)
174
- - `MessageCompiler` was drastically simplified based on the new result AST from dry-logic (solnic)
175
- - `HintCompiler` is gone as hints are now part of the result AST (solnic)
176
- - `maybe` macro creates an implication instead of a disjunction (`not(none?).then(*your-predicates)`) (solnic)
177
-
178
583
  [Compare v0.9.5...v0.10.0](https://github.com/dry-rb/dry-validation/compare/v0.9.5...v0.10.0)
179
584
 
180
- # v0.9.5 2016-08-16
585
+ ## 0.9.5 2016-08-16
586
+
181
587
 
182
588
  ### Fixed
183
589
 
184
590
  - Infering multiple predicates with options works as expected ie `value(:str?, min_size?: 3, max_size?: 6)` (solnic)
185
591
  - Default `locale` configured in `I18n` is now respected by the messages compiler (agustin + cavi21)
186
592
 
593
+
187
594
  [Compare v0.9.4...v0.9.5](https://github.com/dry-rb/dry-validation/compare/v0.9.4...v0.9.5)
188
595
 
189
- # v0.9.4 2016-08-11
596
+ ## 0.9.4 2016-08-11
597
+
190
598
 
191
599
  ### Fixed
192
600
 
193
601
  - Error messages for sibling deeply nested schemas are nested correctly (timriley)
194
602
 
603
+
195
604
  [Compare v0.9.3...v0.9.4](https://github.com/dry-rb/dry-validation/compare/v0.9.3...v0.9.4)
196
605
 
197
- # v0.9.3 2016-07-22
606
+ ## 0.9.3 2016-07-22
607
+
198
608
 
199
609
  ### Added
200
610
 
@@ -212,24 +622,29 @@
212
622
 
213
623
  [Compare v0.9.2...v0.9.3](https://github.com/dry-rb/dry-validation/compare/v0.9.2...v0.9.3)
214
624
 
215
- # v0.9.2 2016-07-13
625
+ ## 0.9.2 2016-07-13
626
+
216
627
 
217
628
  ### Fixed
218
629
 
219
630
  - Constrained types now work with `each` macro (solnic)
220
631
  - Array coercion without member type works now ie `required(:arr).maybe(:array?)` (solnic)
221
632
 
633
+
222
634
  [Compare v0.9.1...v0.9.2](https://github.com/dry-rb/dry-validation/compare/v0.9.1...v0.9.2)
223
635
 
224
- # v0.9.1 2016-07-11
636
+ ## 0.9.1 2016-07-11
637
+
225
638
 
226
639
  ### Fixed
227
640
 
228
641
  - `I18n` backend is no longer required and set by default (solnic)
229
642
 
643
+
230
644
  [Compare v0.9.0...v0.9.1](https://github.com/dry-rb/dry-validation/compare/v0.9.0...v0.9.1)
231
645
 
232
- # v0.9.0 2016-07-08
646
+ ## 0.9.0 2016-07-08
647
+
233
648
 
234
649
  ### Added
235
650
 
@@ -242,10 +657,6 @@
242
657
  - Support for message token transformations in custom predicates (fran-worley)
243
658
  - [EXPERIMENTAL] Ability to compose predicates that accept dynamic args provided by the schema (solnic)
244
659
 
245
- ### Changed
246
-
247
- - Tokens for `size?` were renamed `left` => `size_left` and `right` => `size_right` (fran-worley)
248
-
249
660
  ### Fixed
250
661
 
251
662
  - Duped key names in nested schemas no longer result in invalid error messages structure (solnic)
@@ -255,18 +666,14 @@
255
666
  - Hints for elements are no longer provided for an array when the value is not an array (solnic)
256
667
  - `input` macro no longer messes up error messages for nested structures (solnic)
257
668
 
258
- ### Internal
669
+ ### Changed
259
670
 
260
- - Compiling messages is now ~5% faster (solnic + splattael)
261
- - Refactored Error and Hint compilers (solnic)
262
- - Refactored Schema to use an internal executor objects with steps (solnic)
263
- - Extracted root-rule into a separate validation step (solnic)
264
- - Added `MessageSet` that result objects now use (in 1.0.0 it'll be exposed via public API) (solnic)
265
- - We can now distinguish error messages from validation hints via `Message` and `Hint` objects (solnic)
671
+ - Tokens for `size?` were renamed `left` => `size_left` and `right` => `size_right` (fran-worley)
266
672
 
267
673
  [Compare v0.8.0...v0.9.0](https://github.com/dry-rb/dry-validation/compare/v0.8.0...v0.9.0)
268
674
 
269
- # v0.8.0 2016-07-01
675
+ ## 0.8.0 2016-07-01
676
+
270
677
 
271
678
  ### Added
272
679
 
@@ -312,19 +719,10 @@
312
719
  - Deprecate key in favor of required (coop)
313
720
  - Remove nested key syntax (solnic)
314
721
 
315
- ### Internal
316
-
317
- - ~15% performance boost via various optimizations (solnic)
318
- - When using explicit type specs building a schema is ~80-85x faster (solnic)
319
- - No longer uses `Dry::Types::Predicates` as `:type?` predicate was moved to dry-logic (solnic)
320
- - Integration specs covering predicates with Form and Schema (jodosha)
321
- - Use latest ruby versions on travis (flash-gordon)
322
- - Make pry console optional with IRB as a default (flash-gordon)
323
- - Remove wrapping rules in :set nodes (solnic)
324
-
325
722
  [Compare v0.7.4...v0.8.0](https://github.com/dry-rb/dry-validation/compare/v0.7.4...v0.8.0)
326
723
 
327
- # v0.7.4 2016-04-06
724
+ ## 0.7.4 2016-04-06
725
+
328
726
 
329
727
  ### Added
330
728
 
@@ -335,9 +733,11 @@
335
733
 
336
734
  - Depending on deeply nested values in high-level rules works now (solnic)
337
735
 
736
+
338
737
  [Compare v0.7.3...v0.7.4](https://github.com/dry-rb/dry-validation/compare/v0.7.3...v0.7.4)
339
738
 
340
- # v0.7.3 2016-03-30
739
+ ## 0.7.3 2016-03-30
740
+
341
741
 
342
742
  ### Added
343
743
 
@@ -350,22 +750,22 @@
350
750
  - Creating a nested schema properly sets full path to nested data structure (solnic)
351
751
  - Error message for `empty?` predicate is now correct (jodosha)
352
752
 
353
- ### Internal
354
-
355
- - Switch from `thread_safe` to `concurrent` (joevandyk)
356
753
 
357
754
  [Compare v0.7.2...v0.7.3](https://github.com/dry-rb/dry-validation/compare/v0.7.2...v0.7.3)
358
755
 
359
- # v0.7.2 2016-03-28
756
+ ## 0.7.2 2016-03-28
757
+
360
758
 
361
759
  ### Added
362
760
 
363
761
  - Support for nested schemas inside high-level rules (solnic)
364
762
  - `Schema#to_proc` so that you can do `data.each(&schema)` (solnic)
365
763
 
764
+
366
765
  [Compare v0.7.1...v0.7.2](https://github.com/dry-rb/dry-validation/compare/v0.7.1...v0.7.2)
367
766
 
368
- # v0.7.1 2016-03-21
767
+ ## 0.7.1 2016-03-21
768
+
369
769
 
370
770
  ### Added
371
771
 
@@ -383,7 +783,8 @@
383
783
 
384
784
  [Compare v0.7.0...v0.7.1](https://github.com/dry-rb/dry-validation/compare/v0.7.0...v0.7.1)
385
785
 
386
- # v0.7.0 2016-03-16
786
+ ## 0.7.0 2016-03-16
787
+
387
788
 
388
789
  ### Added
389
790
 
@@ -407,6 +808,12 @@
407
808
  - `Validation::Result` responds to `#[]` and `#each` (delegating to its output)
408
809
  and it's an enumerable (solnic)
409
810
 
811
+ ### Fixed
812
+
813
+ - Qualified rule names properly use last node by default for error messages (solnic)
814
+ - Validation hints only include relevant messages (solnic)
815
+ - `:yaml` messages respect `:locale` option in `Result#messages` (solnic)
816
+
410
817
  ### Changed
411
818
 
412
819
  - `schema` was **removed** from the DSL, just use `key(:name).schema` instead (solnic)
@@ -417,15 +824,10 @@
417
824
  - `Schema::Result` is now `Validation::Result` and it no longer has success and
418
825
  failure results, only error results are provided (solnic)
419
826
 
420
- ### Fixed
421
-
422
- - Qualified rule names properly use last node by default for error messages (solnic)
423
- - Validation hints only include relevant messages (solnic)
424
- - `:yaml` messages respect `:locale` option in `Result#messages` (solnic)
425
-
426
827
  [Compare v0.6.0...v0.7.0](https://github.com/dry-rb/dry-validation/compare/v0.6.0...v0.7.0)
427
828
 
428
- # v0.6.0 2016-01-20
829
+ ## 0.6.0 2016-01-20
830
+
429
831
 
430
832
  ### Added
431
833
 
@@ -436,38 +838,41 @@
436
838
  - Support for `confirmation(:foo, some_predicate: some_argument)` shortcut syntax (solnic)
437
839
  - Support for error messages for grouped rules (like `confirmation`) (solnic)
438
840
  - Schemas support injecting rules from the outside (solnic)
439
-
440
- ## Changed
441
-
841
+ - ## Changed
442
842
  - `rule` uses objects that inherit from `BasicObject` to avoid conflicts with
443
843
  predicate names and built-in `Object` methods (solnic)
444
844
  - In `Schema::Form` both `key` and `optional` will apply `filled?` predicate by
445
845
  default when no block is passed (solnic)
446
846
 
847
+
447
848
  [Compare v0.5.0...v0.6.0](https://github.com/dry-rb/dry-validation/compare/v0.5.0...v0.6.0)
448
849
 
449
- # v0.5.0 2016-01-11
850
+ ## 0.5.0 2016-01-11
450
851
 
451
- ### Changed
452
-
453
- - Now depends on [dry-logic](https://github.com/dry-rb/dry-logic) for predicates and rules (solnic)
454
- - `dry/validation/schema/form` is now required by default (solnic)
455
852
 
456
853
  ### Fixed
457
854
 
458
855
  - `Schema::Form` uses safe `form.array` and `form.hash` types which fixes #42 (solnic)
459
856
 
857
+ ### Changed
858
+
859
+ - Now depends on [dry-logic](https://github.com/dry-rb/dry-logic) for predicates and rules (solnic)
860
+ - `dry/validation/schema/form` is now required by default (solnic)
861
+
460
862
  [Compare v0.4.1...v0.5.0](https://github.com/dry-rb/dry-validation/compare/v0.4.1...v0.5.0)
461
863
 
462
- # v0.4.1 2015-12-27
864
+ ## 0.4.1 2015-12-27
865
+
463
866
 
464
867
  ### Added
465
868
 
466
869
  - Support for `each` and type coercion inference in `Schema::Form` (solnic)
467
870
 
871
+
468
872
  [Compare v0.4.0...v0.4.1](https://github.com/dry-rb/dry-validation/compare/v0.4.0...v0.4.1)
469
873
 
470
- # v0.4.0 2015-12-21
874
+ ## 0.4.0 2015-12-21
875
+
471
876
 
472
877
  ### Added
473
878
 
@@ -481,9 +886,11 @@
481
886
 
482
887
  - Error messages hash has now consistent structure `rule_name => [msgs_array, input_value]` (solnic)
483
888
 
889
+
484
890
  [Compare v0.3.1...v0.4.0](https://github.com/dry-rb/dry-validation/compare/v0.3.1...v0.4.0)
485
891
 
486
- # v0.3.1 2015-12-08
892
+ ## 0.3.1 2015-12-08
893
+
487
894
 
488
895
  ### Added
489
896
 
@@ -493,9 +900,11 @@
493
900
 
494
901
  - Error compiler returns an empty hash rather than a nil when there are no errors (solnic)
495
902
 
903
+
496
904
  [Compare v0.3.0...v0.3.1](https://github.com/dry-rb/dry-validation/compare/v0.3.0...v0.3.1)
497
905
 
498
- # v0.3.0 2015-12-07
906
+ ## 0.3.0 2015-12-07
907
+
499
908
 
500
909
  ### Added
501
910
 
@@ -517,9 +926,10 @@
517
926
  errors and messages
518
927
  - `Schema::Result#messages` returns a hash with rule names, messages and input values (solnic)
519
928
 
520
- [Compare v0.2.0...HEAD](https://github.com/dry-rb/dry-validation/compare/v0.2.0...HEAD)
929
+ [Compare v0.2.0...v0.3.0](https://github.com/dry-rb/dry-validation/compare/v0.2.0...v0.3.0)
930
+
931
+ ## 0.2.0 2015-11-30
521
932
 
522
- # v0.2.0 2015-11-30
523
933
 
524
934
  ### Added
525
935
 
@@ -540,8 +950,9 @@
540
950
 
541
951
  - Added missing `and` / `or` interfaces to composite rules (solnic)
542
952
 
543
- [Compare v0.1.0...HEAD](https://github.com/dry-rb/dry-validation/compare/v0.1.0...HEAD)
544
953
 
545
- # v0.1.0 2015-11-25
954
+ [Compare v0.1.0...v0.2.0](https://github.com/dry-rb/dry-validation/compare/v0.1.0...v0.2.0)
955
+
956
+ ## 0.1.0 2015-11-25
546
957
 
547
958
  First public release