mega-sharp-sys 0.0.1

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 (76) hide show
  1. checksums.yaml +7 -0
  2. data/dry-schema-1.16.0/CHANGELOG.md +901 -0
  3. data/dry-schema-1.16.0/LICENSE +20 -0
  4. data/dry-schema-1.16.0/README.md +17 -0
  5. data/dry-schema-1.16.0/config/errors.yml +127 -0
  6. data/dry-schema-1.16.0/dry-schema.gemspec +50 -0
  7. data/dry-schema-1.16.0/lib/dry/schema/compiler.rb +51 -0
  8. data/dry-schema-1.16.0/lib/dry/schema/config.rb +83 -0
  9. data/dry-schema-1.16.0/lib/dry/schema/constants.rb +47 -0
  10. data/dry-schema-1.16.0/lib/dry/schema/dsl.rb +517 -0
  11. data/dry-schema-1.16.0/lib/dry/schema/extensions/hints/compiler_methods.rb +19 -0
  12. data/dry-schema-1.16.0/lib/dry/schema/extensions/hints/message_compiler_methods.rb +89 -0
  13. data/dry-schema-1.16.0/lib/dry/schema/extensions/hints/message_set_methods.rb +44 -0
  14. data/dry-schema-1.16.0/lib/dry/schema/extensions/hints/result_methods.rb +47 -0
  15. data/dry-schema-1.16.0/lib/dry/schema/extensions/hints.rb +65 -0
  16. data/dry-schema-1.16.0/lib/dry/schema/extensions/info/schema_compiler.rb +123 -0
  17. data/dry-schema-1.16.0/lib/dry/schema/extensions/info.rb +27 -0
  18. data/dry-schema-1.16.0/lib/dry/schema/extensions/json_schema/schema_compiler.rb +314 -0
  19. data/dry-schema-1.16.0/lib/dry/schema/extensions/json_schema.rb +29 -0
  20. data/dry-schema-1.16.0/lib/dry/schema/extensions/monads.rb +32 -0
  21. data/dry-schema-1.16.0/lib/dry/schema/extensions/struct.rb +62 -0
  22. data/dry-schema-1.16.0/lib/dry/schema/extensions.rb +21 -0
  23. data/dry-schema-1.16.0/lib/dry/schema/json.rb +17 -0
  24. data/dry-schema-1.16.0/lib/dry/schema/key.rb +184 -0
  25. data/dry-schema-1.16.0/lib/dry/schema/key_coercer.rb +41 -0
  26. data/dry-schema-1.16.0/lib/dry/schema/key_map.rb +136 -0
  27. data/dry-schema-1.16.0/lib/dry/schema/key_validator.rb +117 -0
  28. data/dry-schema-1.16.0/lib/dry/schema/macros/array.rb +54 -0
  29. data/dry-schema-1.16.0/lib/dry/schema/macros/core.rb +55 -0
  30. data/dry-schema-1.16.0/lib/dry/schema/macros/dsl.rb +282 -0
  31. data/dry-schema-1.16.0/lib/dry/schema/macros/each.rb +31 -0
  32. data/dry-schema-1.16.0/lib/dry/schema/macros/filled.rb +58 -0
  33. data/dry-schema-1.16.0/lib/dry/schema/macros/hash.rb +36 -0
  34. data/dry-schema-1.16.0/lib/dry/schema/macros/key.rb +50 -0
  35. data/dry-schema-1.16.0/lib/dry/schema/macros/maybe.rb +38 -0
  36. data/dry-schema-1.16.0/lib/dry/schema/macros/optional.rb +22 -0
  37. data/dry-schema-1.16.0/lib/dry/schema/macros/required.rb +17 -0
  38. data/dry-schema-1.16.0/lib/dry/schema/macros/schema.rb +103 -0
  39. data/dry-schema-1.16.0/lib/dry/schema/macros/value.rb +125 -0
  40. data/dry-schema-1.16.0/lib/dry/schema/message/or/abstract.rb +28 -0
  41. data/dry-schema-1.16.0/lib/dry/schema/message/or/multi_path.rb +100 -0
  42. data/dry-schema-1.16.0/lib/dry/schema/message/or/single_path.rb +72 -0
  43. data/dry-schema-1.16.0/lib/dry/schema/message/or.rb +30 -0
  44. data/dry-schema-1.16.0/lib/dry/schema/message.rb +116 -0
  45. data/dry-schema-1.16.0/lib/dry/schema/message_compiler/visitor_opts.rb +56 -0
  46. data/dry-schema-1.16.0/lib/dry/schema/message_compiler.rb +234 -0
  47. data/dry-schema-1.16.0/lib/dry/schema/message_set.rb +144 -0
  48. data/dry-schema-1.16.0/lib/dry/schema/messages/abstract.rb +202 -0
  49. data/dry-schema-1.16.0/lib/dry/schema/messages/i18n.rb +139 -0
  50. data/dry-schema-1.16.0/lib/dry/schema/messages/namespaced.rb +93 -0
  51. data/dry-schema-1.16.0/lib/dry/schema/messages/template.rb +43 -0
  52. data/dry-schema-1.16.0/lib/dry/schema/messages/yaml.rb +209 -0
  53. data/dry-schema-1.16.0/lib/dry/schema/messages.rb +32 -0
  54. data/dry-schema-1.16.0/lib/dry/schema/namespaced_rule.rb +38 -0
  55. data/dry-schema-1.16.0/lib/dry/schema/params.rb +17 -0
  56. data/dry-schema-1.16.0/lib/dry/schema/path.rb +107 -0
  57. data/dry-schema-1.16.0/lib/dry/schema/predicate.rb +102 -0
  58. data/dry-schema-1.16.0/lib/dry/schema/predicate_inferrer.rb +25 -0
  59. data/dry-schema-1.16.0/lib/dry/schema/predicate_registry.rb +22 -0
  60. data/dry-schema-1.16.0/lib/dry/schema/primitive_inferrer.rb +22 -0
  61. data/dry-schema-1.16.0/lib/dry/schema/processor.rb +213 -0
  62. data/dry-schema-1.16.0/lib/dry/schema/processor_steps.rb +141 -0
  63. data/dry-schema-1.16.0/lib/dry/schema/result.rb +203 -0
  64. data/dry-schema-1.16.0/lib/dry/schema/rule_applier.rb +47 -0
  65. data/dry-schema-1.16.0/lib/dry/schema/step.rb +59 -0
  66. data/dry-schema-1.16.0/lib/dry/schema/trace.rb +114 -0
  67. data/dry-schema-1.16.0/lib/dry/schema/type_container.rb +27 -0
  68. data/dry-schema-1.16.0/lib/dry/schema/type_registry.rb +44 -0
  69. data/dry-schema-1.16.0/lib/dry/schema/types.rb +14 -0
  70. data/dry-schema-1.16.0/lib/dry/schema/types_merger.rb +139 -0
  71. data/dry-schema-1.16.0/lib/dry/schema/value_coercer.rb +36 -0
  72. data/dry-schema-1.16.0/lib/dry/schema/version.rb +7 -0
  73. data/dry-schema-1.16.0/lib/dry/schema.rb +114 -0
  74. data/dry-schema-1.16.0/lib/dry-schema.rb +3 -0
  75. data/mega-sharp-sys.gemspec +11 -0
  76. metadata +114 -0
@@ -0,0 +1,901 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Break Versioning](https://www.taoensso.com/break-versioning).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ ### Changed
13
+
14
+ ### Deprecated
15
+
16
+ ### Removed
17
+
18
+ ### Fixed
19
+
20
+ ### Security
21
+
22
+ [Unreleased]: https://github.com/dry-rb/dry-schema/compare/v1.16.0...main
23
+
24
+ ## [1.16.0] - 2026-03-03
25
+
26
+ ### Added
27
+
28
+ - Support JRuby (@katafrakt in #512, @timriley in 1a6202f)
29
+
30
+ ### Changed
31
+
32
+ - In JSON Schema output, represent values with an `eql?` constraint as "const" values. (@adamransom in #514)
33
+ ```ruby
34
+ require "dry/schema"
35
+ Dry::Schema.load_extensions(:json_schema)
36
+
37
+ schema = Dry::Schema.JSON do
38
+ required(:version).value(:integer, eql?: 1)
39
+ end
40
+
41
+ schema.json_schema
42
+ # => {"$schema": "http://json-schema.org/draft-06/schema#", type: "object", properties: {version: {type: "integer", const: 1}}, required: ["version"]}
43
+ ```
44
+
45
+ ### Fixed
46
+
47
+ - In JSON Schema output, fix representation of arrays that are a combinations of schemas. (@adamransom in #516)
48
+ - Avoid mutation of arguments given to `Dry::Schema::Messages::I18n#get`. (@flash-gordon in 51d48b6)
49
+
50
+ [1.16.0]: https://github.com/dry-rb/dry-schema/compare/v1.15.0...v1.16.0
51
+
52
+ ## [1.15.0] - 2026-01-09
53
+
54
+ ### Changed
55
+
56
+ - Set mimimum Ruby version to 3.2 (@timriley)
57
+ - Support UUID v6, v7 and v8 predicates (`:uuid_v6?`, `:uuid_v7?` and `:uuid_v8?`). (@illiatdesdindes in #509)
58
+ - Support `size?`, `format?`, `true?` and `false?` predicates when generating JSON schemas. (@cramt in #499)
59
+ - Allow symbols to be given for `top_namespace` setting. (@unused in #491)
60
+
61
+ ### Fixed
62
+
63
+ - Support intersection types (created with `&` operator) in schema definitions. (@baweaver in #496)
64
+
65
+ Now works without errors:
66
+ ```ruby
67
+ intersection_type =
68
+ Types::Hash.schema(a: Types::String) &
69
+ (Types::Hash.schema(b: Types::String) | Types::Hash.schema(c: Types::String))
70
+
71
+ schema = Dry::Schema.Params do
72
+ required(:body).value(intersection_type)
73
+ end
74
+
75
+ schema.call(body: {a: "test", b: "value"}) # passes
76
+ schema.call(body: {b: "value"}) # fails - missing 'a'
77
+ ```
78
+ - JSON schema generation now properly handles `Dry::Struct` instances wrapped in constructors. (@baweaver in #497)
79
+
80
+ Before, when generating JSON schema for a schema containing a Dry::Struct wrapped in a constructor (e.g., `Address.constructor(&:itself)`), all struct properties were omitted from the generated schema, returning only `{type: "object"}` instead of the full schema with properties.
81
+
82
+ Before/after:
83
+ ```ruby
84
+ # Before: Missing struct properties
85
+ Dry::Schema.Params do
86
+ required(:address).value(Address.constructor(&:itself))
87
+ end.json_schema
88
+ # => {:properties=>{:address=>{:type=>"object"}}} # No properties
89
+
90
+ # After: Full struct schema included
91
+ Dry::Schema.Params do
92
+ required(:address).value(Address.constructor(&:itself))
93
+ end.json_schema
94
+ # => {:properties=>{:address=>{:type=>"object", :properties=>{:street=>{...}}}}} # Properties included
95
+ ```
96
+ - JSON schema generation now correctly uses `minItems`/`maxItems` for array size predicates instead of `minLength`/`maxLength`. (@baweaver in #498)
97
+ - Show correct index in errors when validating unexpected keys in arrays. (@katafrakt in #510)
98
+ - Support validating nested arrays when using `config.validate_keys = true`. (@misdoro in #508)
99
+ - Fix handling of i18n messages from proc/lambda-produced hashes. (@rrothenberger in #493)
100
+ - Fix error arising when generating errors when a key is repeated in a nested schema. (@jacob-carlborg in #503)
101
+ - Fix method call typo in `Dry::Schema::Trace#respond_to_missing?`. (@flash-gordon in 13ddb51)
102
+
103
+ [1.15.0]: https://github.com/dry-rb/dry-schema/compare/v1.14.1...v1.15.0
104
+
105
+ ## [1.14.1] - 2025-03-03
106
+
107
+ ### Fixed
108
+
109
+ - Syntax errors on 3.3.0 (@flash-gordon, see #488)
110
+
111
+ [1.14.1]: https://github.com/dry-rb/dry-schema/compare/v1.14.0...v1.14.1
112
+
113
+ ## [1.14.0] - 2025-01-06
114
+
115
+ ### Added
116
+
117
+ - Better support for sets in `excluded_from?` and `included_in?` predicates (via #480) (@flash-gordon)
118
+
119
+ ### Fixed
120
+
121
+ - Fix info extension for maybe macro (via #484) (@flash-gordon + @santiagodoldan)
122
+ - Missing message for :uri? predicate (via #477) (@timjnh)
123
+ - JSON schema output for `maybe(:array)` (via #463) (@tomgi)
124
+
125
+ ### Changed
126
+
127
+ - Set minimum Ruby version to 3.1 (@flash-gordon)
128
+ - `KeyValidator` works faster for large schemas (via #461) (@radarek)
129
+
130
+ [1.14.0]: https://github.com/dry-rb/dry-schema/compare/v1.13.4...v1.14.0
131
+
132
+ ## [1.13.4] - 2024-05-22
133
+
134
+ ### Added
135
+
136
+ - Default error message for `:uri?` (issue #476 via #477) (@timjnh)
137
+
138
+ ### Fixed
139
+
140
+ - Fix json-schema type of objects nested under arrays (issue #400 fixed via #462) (@tomgi)
141
+
142
+ ### Changed
143
+
144
+ - i18n backend is no longer eager-loaded (via 85a9e0b) (@adam12)
145
+
146
+ [1.13.4]: https://github.com/dry-rb/dry-schema/compare/v1.13.3...v1.13.4
147
+
148
+ ## [1.13.3] - 2023-08-26
149
+
150
+ ### Fixed
151
+
152
+ - Fix struct extension for nested struct definitions (via #466) (@flash-gordon)
153
+
154
+ [1.13.3]: https://github.com/dry-rb/dry-schema/compare/v1.13.2...v1.13.3
155
+
156
+ ## [1.13.2] - 2023-05-31
157
+
158
+ ### Fixed
159
+
160
+ - Fix custom predicates setting (via #460) (@solnic)
161
+
162
+ [1.13.2]: https://github.com/dry-rb/dry-schema/compare/v1.13.1...v1.13.2
163
+
164
+ ## [1.13.1] - 2023-04-07
165
+
166
+ ### Fixed
167
+
168
+ - Support sum types of hashes (issue #446 fixed via #457) (@segiddins)
169
+
170
+ [1.13.1]: https://github.com/dry-rb/dry-schema/compare/v1.13.0...v1.13.1
171
+
172
+ ## [1.13.0] - 2022-11-24
173
+
174
+ ### Fixed
175
+
176
+ - Change required metadata back to true to fix regressions (issue #438 fixed via 439) (@robhanlon22)
177
+ - Compatibility with dry-configurable 1.0.1 (@flash-gordon)
178
+ - Warnings about using pattern matching on Ruby 2.7 (issue #441 fixed via #442) (@r7kamura)
179
+ - Make message cache fully thread-safe (via #440) (@mensfeld)
180
+
181
+ [1.13.0]: https://github.com/dry-rb/dry-schema/compare/v1.12.0...v1.13.0
182
+
183
+ ## [1.12.0] - 2022-11-04
184
+
185
+ ### Changed
186
+
187
+ - This version depends on dry-core 1.0 and dry-configurable 1.0 (@flash-gordon)
188
+
189
+ [1.12.0]: https://github.com/dry-rb/dry-schema/compare/v1.11.3...v1.12.0
190
+
191
+ ## [1.11.3] - 2022-10-21
192
+
193
+ ### Fixed
194
+
195
+ - Fixed `array(sum_type)` syntax which was a regression introduced in 1.10.0 (issue #436 fixed via #437) (@solnic)
196
+
197
+ [1.11.3]: https://github.com/dry-rb/dry-schema/compare/v1.11.2...v1.11.3
198
+
199
+ ## [1.11.2] - 2022-10-16
200
+
201
+ ### Fixed
202
+
203
+ - Setting up message backends with custom settings should work as before (see dry-rb/dry-validation#717 fixed via #435) (@solnic)
204
+
205
+ [1.11.2]: https://github.com/dry-rb/dry-schema/compare/v1.11.1...v1.11.2
206
+
207
+ ## [1.11.1] - 2022-10-15
208
+
209
+ ### Changed
210
+
211
+ - Depend on dry-configurable >= 0.16 - this was needed to play nice with Zeitwerk (@solnic)
212
+
213
+ [1.11.1]: https://github.com/dry-rb/dry-schema/compare/v1.11.0...v1.11.1
214
+
215
+ ## [1.11.0] - 2022-10-15
216
+
217
+ ### Changed
218
+
219
+ - Use zeitwerk for auto-loading which speeds up requires (via #427) (@flash-gordon + @solnic)
220
+
221
+ [1.11.0]: https://github.com/dry-rb/dry-schema/compare/v1.10.6...v1.11.0
222
+
223
+ ## [1.10.6] - 2022-10-01
224
+
225
+ ### Fixed
226
+
227
+ - Fix issues with rule name when top_namespace and namespace passed (issue #304 fixed via #432) (@RudskikhIvan)
228
+
229
+ [1.10.6]: https://github.com/dry-rb/dry-schema/compare/v1.10.5...v1.10.6
230
+
231
+ ## [1.10.5] - 2022-09-21
232
+
233
+ ### Fixed
234
+
235
+ - Key maps no longer include duped keys when using inheritance (issues #428 #372 fixed via #429) (@solnic)
236
+ - Key validator and coercer no longer include duped keys when using parent schemas (via #430) (@solnic)
237
+
238
+ [1.10.5]: https://github.com/dry-rb/dry-schema/compare/v1.10.4...v1.10.5
239
+
240
+ ## [1.10.4] - 2022-09-13
241
+
242
+ ### Fixed
243
+
244
+ - Once again reverting zeitwerk related changes that were included in 1.10.3 by an accident :( (@solnic)
245
+
246
+ [1.10.4]: https://github.com/dry-rb/dry-schema/compare/v1.10.3...v1.10.4
247
+
248
+ ## [1.10.3] - 2022-09-10
249
+
250
+ ### Fixed
251
+
252
+ - Addressed regressions causing issues with handling sum types (see #419 and #423 fixed via #425) (@robhanlon22)
253
+
254
+ [1.10.3]: https://github.com/dry-rb/dry-schema/compare/v1.10.2...v1.10.3
255
+
256
+ ## [1.10.2] - 2022-08-23
257
+
258
+ ### Fixed
259
+
260
+ - Fix value coercion for composed schemas (via #421) (@robhanlon22)
261
+
262
+ [1.10.2]: https://github.com/dry-rb/dry-schema/compare/v1.10.1...v1.10.2
263
+
264
+ ## [1.10.1] - 2022-08-22
265
+
266
+ ### Changed
267
+
268
+ - Reverted zeitwerk-related changes that were included in 1.10.0 by an accident (@solnic)
269
+
270
+ [1.10.1]: https://github.com/dry-rb/dry-schema/compare/v1.10.0...v1.10.1
271
+
272
+ ## [1.10.0] - 2022-08-16
273
+
274
+ ### Added
275
+
276
+ - Allow nested `filled` and `value` macro usage (via #412) (@robhanlon22)
277
+ - Support for more complex scenarios when composing schemas (via #420) (@robhanlon22)
278
+
279
+ ### Fixed
280
+
281
+ - Fix `or` messages for complex schemas (via #413) (@robhanlon22)
282
+ - Using `filled` with a constrained constructor type works as expected (via #416) (@robhanlon22)
283
+ - Fix types and key maps for composed schemas (via #415) (@robhanlon22)
284
+
285
+ ### Changed
286
+
287
+ - Freeze message hash (fixes #417 via #418) (@solnic)
288
+
289
+ [1.10.0]: https://github.com/dry-rb/dry-schema/compare/v1.9.3...v1.10.0
290
+
291
+ ## [1.9.3] - 2022-06-23
292
+
293
+ ### Added
294
+
295
+ - Support `anyOf` composition in JSON schema output (@robhanlon22)
296
+
297
+ ### Fixed
298
+
299
+ - Allow composition of multiple ors (issue #307 fixed via #409) (@robhanlon22)
300
+
301
+ [1.9.3]: https://github.com/dry-rb/dry-schema/compare/v1.9.2...v1.9.3
302
+
303
+ ## [1.9.2] - 2022-05-28
304
+
305
+ ### Fixed
306
+
307
+ - Fix loose JSON schemas for nested hashes (via #401) (@tomdalling)
308
+ - Correct spelling error 'mininum' to 'minimum' in json-schema extension (via #404) (@svenanderzen)
309
+
310
+ ### Changed
311
+
312
+ - [performance] YAML message backend allocates less strings (via #399) (@casperisfine)
313
+
314
+ [1.9.2]: https://github.com/dry-rb/dry-schema/compare/v1.9.1...v1.9.2
315
+
316
+ ## [1.9.1] - 2022-02-17
317
+
318
+ ### Fixed
319
+
320
+ - Namespaced messages no longer crashes in certain scenarios (see dry-rb/dry-validation#692 fixed via #398) (@krekoten)
321
+
322
+ [1.9.1]: https://github.com/dry-rb/dry-schema/compare/v1.9.0...v1.9.1
323
+
324
+ ## [1.9.0] - 2022-02-15
325
+
326
+ ### Added
327
+
328
+ - [EXPERIMENTAL] `json_schema` extension which allows you to convert a schema into a JSON schema (via #369) (@ianks)
329
+
330
+ ### Fixed
331
+
332
+ - Composing schemas no longer crashes in certain scenarios (issue #342 fixed via #366) (@vsuhachev)
333
+ - Fix info extension for typed arrays (issue #394 fixed via #397) (@CandyFet)
334
+
335
+ [1.9.0]: https://github.com/dry-rb/dry-schema/compare/v1.8.0...v1.9.0
336
+
337
+ ## [1.8.0] - 2021-09-12
338
+
339
+ ### Changed
340
+
341
+ - [internal] Upgraded to new `setting` API provided in dry-configurable 0.13.0 (@timriley in #356)
342
+
343
+ [1.8.0]: https://github.com/dry-rb/dry-schema/compare/v1.7.1...v1.8.0
344
+
345
+ ## [1.7.1] - 2021-08-29
346
+
347
+ ### Changed
348
+
349
+ - [internal] Use explicit `#to_h` conversion of Dry::Configurable::Config, to ensure compatibility with upcoming dry-configurable 0.13.0 release (via #371) (@timriley)
350
+
351
+ [1.7.1]: https://github.com/dry-rb/dry-schema/compare/v1.7.0...v1.7.1
352
+
353
+ ## [1.7.0] - 2021-06-29
354
+
355
+ This release ships with a bunch of internal refactorings that should improve performance but if you see any unexpected behavior please do report issues.
356
+
357
+ ### Fixed
358
+
359
+ - Handle arrays of hashes where Array constructor coerces non-Hash input (#351 fixed via #354) (@ojab)
360
+ - Run outer schema processor steps before inner ones (issue #350 fixed via #361) (@ojab)
361
+ - Fix key validator false negatives on empty collections (see #363) (@Drenmi)
362
+ - Prevent error message YAML files from being parsed multiple times (issue #352 via #364) (@alassek)
363
+ - Using constructor types should work fine now ie `required(:foo).filled(Types::Params::Integer.constructor(&:succ))` (issue #280 fixed via #365) (@solnic)
364
+ - Handle non-Hash to Hash transformation in `before(:key_coercer)` (issue #350 fixed via #362) (@ojab)
365
+
366
+ ### Changed
367
+
368
+ - [internal] `Dry::Schema::Path` clean up and performance improvements (via #358) (@ojab)
369
+ - [internal] simplify and speed up handling of steps in nested schemas (via #360) (@ojab)
370
+
371
+ [1.7.0]: https://github.com/dry-rb/dry-schema/compare/v1.6.2...v1.7.0
372
+
373
+ ## [1.6.2] - 2021-04-15
374
+
375
+ ### Added
376
+
377
+ - A default error message for `respond_to?` predicate (@rindek)
378
+
379
+ ### Fixed
380
+
381
+ - Using `respond_to?` predicate in blocks works now (@rindek)
382
+
383
+ [1.6.2]: https://github.com/dry-rb/dry-schema/compare/v1.6.1...v1.6.2
384
+
385
+ ## [1.6.1] - 2021-02-02
386
+
387
+ ### Fixed
388
+
389
+ - Messages#[] handles meta/no meta cases more gracefully and has better interoperability with the I18n backend. This brings MessageCompiler#visit_unexpected_key up to parity with MessageCompiler#visit_predicate. Uses visit_predicate as basis for visit_unexpected_key. (@robhanlon22)
390
+
391
+ [1.6.1]: https://github.com/dry-rb/dry-schema/compare/v1.6.0...v1.6.1
392
+
393
+ ## [1.6.0] - 2021-01-21
394
+
395
+ ### Fixed
396
+
397
+ - Using sum types with a i18n backend no longer crashes (issue #328 fixes via #331) (@tylerhunt)
398
+
399
+ ### Changed
400
+
401
+ - Inferring predicates from class names is deprecated. It's very unlikely your code depends on it,
402
+ however, if it does, you'll get an exception with instructions. (@flash-gordon)
403
+
404
+ If you see an exception and don't rely on inferring, just disable it with:
405
+
406
+ ```ruby
407
+ Dry::Schema::PredicateInferrer::Compiler.infer_predicate_by_class_name false
408
+ ```
409
+
410
+ Otherwise, enable it explicitly:
411
+
412
+ ```ruby
413
+ Dry::Schema::PredicateInferrer::Compiler.infer_predicate_by_class_name true
414
+ ```
415
+
416
+ See https://github.com/dry-rb/dry-schema/issues/335 for rationale.
417
+
418
+ [1.6.0]: https://github.com/dry-rb/dry-schema/compare/v1.5.6...v1.6.0
419
+
420
+ ## [1.5.6] - 2020-10-21
421
+
422
+ ### Fixed
423
+
424
+ - Fixed stack error which was a regression introduced in 1.5.5 (issue #322 fixed via #323) (@flash-gordon)
425
+
426
+ [1.5.6]: https://github.com/dry-rb/dry-schema/compare/v1.5.5...v1.5.6
427
+
428
+ ## [1.5.5] - 2020-10-08
429
+
430
+ ### Fixed
431
+
432
+ - Key validation works with messages that have meta-data (issue #310 fixed via #313) (@tadeusz-niemiec)
433
+ - Using an external schema along with a key specified as a `:hash` works as expected (issue #296 fixed via #315) (@tadeusz-niemiec + @solnic)
434
+ - `Result#error?(path)` works correctly when the path points to an array item (issue #317 fixed via #318) (@solnic)
435
+
436
+ [1.5.5]: https://github.com/dry-rb/dry-schema/compare/v1.5.4...v1.5.5
437
+
438
+ ## [1.5.4] - 2020-09-03
439
+
440
+ ### Fixed
441
+
442
+ - Key validation works correctly with a non-nested maybe hashes (issue #311 fixed via #312) (@svobom57)
443
+
444
+ ## [1.5.3] - 2020-08-21
445
+
446
+ ### Fixed
447
+
448
+ - Key validator works correctly with an array with maybe hash as its member (issue #308 fixed via #309) (@tadeusz-niemiec)
449
+
450
+ ### Changed
451
+
452
+ - [info extension] small performance improvement in the set visitor (see #305 for more details) (@esparta)
453
+
454
+ [1.5.3]: https://github.com/dry-rb/dry-schema/compare/v1.5.2...v1.5.3
455
+
456
+ ## [1.5.2] - 2020-06-26
457
+
458
+ ### Fixed
459
+
460
+ - `Result#{success?,failure?}` work as expected when there are only key validation failures (issue #297 fixed via #298) (@adamransom)
461
+
462
+ ### Changed
463
+
464
+ - Using `full` option no longer adds a space between the name of a key and the message in case of languages that have no spaces between words (ie Japanese) (issue #161 closed via #292 by @tadeusz-niemiec)
465
+
466
+ [1.5.2]: https://github.com/dry-rb/dry-schema/compare/v1.5.1...v1.5.2
467
+
468
+ ## [1.5.1] - 2020-05-21
469
+
470
+ ### Fixed
471
+
472
+ - Negated predicates support the logic operator API now (fixed via #276 by @solnic)
473
+ - Fixed circular require warning (issue #279 closed via #282 by @landongrindheim)
474
+ - Validating keys against an array with non-hash members no longer crashes (issue #283 fixed via #284 by @beechnut and issue #289 fixed via #288 by @tadeusz-niemiec)
475
+
476
+ [1.5.1]: https://github.com/dry-rb/dry-schema/compare/v1.5.0...v1.5.1
477
+
478
+ ## [1.5.0] - 2020-03-11
479
+
480
+ ### Added
481
+
482
+ - Support for complex sum types ie `value([:integer, array[:integer])` (issue #214) (@solnic)
483
+ - You can now set global config via `Dry::Schema.config` (issue #205) (@robhanlon22)
484
+ - Default error message for `:uuid_v4?` predicate (isssue #230) (@solnic)
485
+ - [experimental] you can compose schemas in the DSL using the standard logic operators (issue #231 closed via #245) (@solnic)
486
+ - Hash schema type can now be used with proper keys and predicates inferring. Constructor
487
+ and default types are explicitly not supported (@flash-gordon)
488
+ ```ruby
489
+ UserType = Dry::Types['hash'].schema(
490
+ name: 'string',
491
+ email: 'string'
492
+ )
493
+
494
+ Dry::Schema.define do
495
+ require(:user).hash(UserType)
496
+ end
497
+ ```
498
+ - `:struct` extension which allows using dry-struct classes as source for hash schemas. Note that output will still be presented as plain hashes, returning structs from schemas will require more work, it's planned for next versions (@flash-gordon)
499
+ - `:info` extension which adds #info method to your schemas which produces a simple hash providing information about keys and types (issue #36 closed via #262) (@solnic)
500
+
501
+ ### Fixed
502
+
503
+ - `maybe` macro in JSON schemas no longer converts empty strings to `nil`.
504
+ This was a bug in dry-types but your code may rely on this behavior. If you still
505
+ require this behavior, we recommend using a custom type (see Advanced -> Custom types in the docs) (@flash-gordon)
506
+ - YAML message backend no longer crashes when load_paths are empty (@robhanlon22)
507
+ - Callbacks can now be inherited from multiple parents (@skryukov)
508
+ - Callbacks work with nested schemas (issue #209) (@solnic)
509
+ - Custom type is respected when defining nested schemas (issue #174 closed via 263) (@solnic)
510
+ - Key map is properly inferred for maybe-hashes (issue #266 fixed via #269) (@solnic)
511
+
512
+ ### Changed
513
+
514
+ - `:i18n` message backend delegates interpolation and caching to `I18n` (issue #211) (@robhanlon22)
515
+ - Raise ArgumentError in DSL if parent DSL configs differ (@robhanlon22)
516
+ - (internal) `PredicateInferrer` was removed. `Dry::Types::PredicateInferrer` is a drop-in replacement (@flash-gordon)
517
+
518
+ [1.5.0]: https://github.com/dry-rb/dry-schema/compare/v1.4.3...v1.5.0
519
+
520
+ ## [1.4.3] - 2020-01-08
521
+
522
+ ### Added
523
+
524
+ - Pattern matching for `Dry::Schema::Result` objects (@flash-gordon)
525
+ ```ruby
526
+ schema = Dry::Schema::Params { required(:name).filled }
527
+ case schema.('name' => 'John')
528
+ in name:
529
+ name # => 'John'
530
+ end
531
+ ```
532
+ Try it with monads!
533
+ - Shortcut for nested schemas in `value` and `maybe` macros (@waiting-for-dev)
534
+ ```ruby
535
+ Dry::Schema.Params do
536
+ required(:address).value(:hash) do
537
+ required(:city).filled
538
+ end
539
+ end
540
+ ```
541
+
542
+ ### Fixed
543
+
544
+ - Some keyword warnings that slipped into the previous release (@flash-gordon)
545
+
546
+ [1.4.3]: https://github.com/dry-rb/dry-schema/compare/v1.4.2...v1.4.3
547
+
548
+ ## [1.4.2] - 2019-12-19
549
+
550
+ ### Fixed
551
+
552
+ - `I18n` messages backend supports procs as text properly (issue #208) (@robhanlon22)
553
+ - `I18n` messages backend supports message meta-data (issue #210) (@robhanlon22)
554
+ - Fixed keyword warnings from MRI 2.7.0 (@flash-gordon)
555
+ - Array with a member works correctly with `maybe` (issue #206) (@solnic)
556
+
557
+ [1.4.2]: https://github.com/dry-rb/dry-schema/compare/v1.4.1...v1.4.2
558
+
559
+ ## [1.4.1] - 2019-10-08
560
+
561
+ ### Fixed
562
+
563
+ - Child schemas no longer mutate processing steps of their parent classes (@skryukov)
564
+
565
+ [1.4.1]: https://github.com/dry-rb/dry-schema/compare/v1.4.0...v1.4.1
566
+
567
+ ## [1.4.0] - 2019-10-08
568
+
569
+ ### Added
570
+
571
+ - Support for passing multiple parent schemas. They are inherited from left to right (@ianwhite)
572
+
573
+ ```ruby
574
+ Dry::Schema.define(parent: [parent_a, parent_b, parent_c]) do
575
+ ...
576
+ end
577
+ ```
578
+ - Improved error messages about missing translations (@skryukov)
579
+ - [experimental] before/after callbacks for schema steps (@skryukov)
580
+
581
+ ```ruby
582
+ Dry::Schema.Params do
583
+ required(:name).value(:string)
584
+ optional(:age).value(:integer)
585
+
586
+ before(:value_coercer) do |result|
587
+ result.to_h.compact
588
+ end
589
+ end
590
+ ```
591
+
592
+ ### Fixed
593
+
594
+ - Added/fixed support for custom optional types (@flash-gordon)
595
+
596
+ [1.4.0]: https://github.com/dry-rb/dry-schema/compare/v1.3.4...v1.4.0
597
+
598
+ ## [1.3.4] - 2019-09-11
599
+
600
+ ### Fixed
601
+
602
+ - Fixed regression where using `array?` predicate within a block would crach (issue #186) (@skryukov)
603
+
604
+ [1.3.4]: https://github.com/dry-rb/dry-schema/compare/v1.3.3...v1.3.4
605
+
606
+ ## [1.3.3] - 2019-08-14
607
+
608
+ ### Fixed
609
+
610
+ - Reject attempts to build a nested schema for array types built on `Dry::Types::Nominal` (fixed #171) (@flash-gordon)
611
+ - Current `I18n.locale` is now properly handled when caching message templates (@flash-gordon)
612
+ - Default processor uses strict types by default, which fixes various cases when `maybe` is used with a constructor type (@flash-gordon)
613
+ - Namespaced messages no longer causes a crash when used with nested schemas (fixed #176) (@solnic)
614
+
615
+ [1.3.3]: https://github.com/dry-rb/dry-schema/compare/v1.3.2...v1.3.3
616
+
617
+ ## [1.3.2] - 2019-08-01
618
+
619
+ ### Added
620
+
621
+ - Support for new predicates: `bytesize?`, `min_bytesize?` and `max_bytesize?` (@bmalinconico)
622
+
623
+ [1.3.2]: https://github.com/dry-rb/dry-schema/compare/v1.3.1...v1.3.2
624
+
625
+ ## [1.3.1] - 2019-07-08
626
+
627
+ ### Fixed
628
+
629
+ - `Result#error?` works correctly with nested hashes and arrays (@solnic)
630
+ - `:hints` extension no longer causes a crash where base messages are generated too (issue #165) (@solnic)
631
+
632
+ [1.3.1]: https://github.com/dry-rb/dry-schema/compare/v1.3.0...v1.3.1
633
+
634
+ ## [1.3.0] - 2019-07-06
635
+
636
+ ### Added
637
+
638
+ - Automatic predicate inferring for constrained types! (@flash-gordon)
639
+
640
+ ```ruby
641
+ Types::Name = Types::String.constrained(min_size: 1)
642
+
643
+ schema = Dry::Schema.define do
644
+ required(:name).value(Types::Name)
645
+ end
646
+
647
+ schema.(name: '').errors.to_h # => { name: ["size cannot be less than 1"] }
648
+ ```
649
+ - Support for redefining re-used schemas (issue #43) (@skryukov)
650
+
651
+ ### Fixed
652
+
653
+ - Type container is passed down to nested schemas (@flash-gordon)
654
+
655
+ [1.3.0]: https://github.com/dry-rb/dry-schema/compare/v1.2.0...v1.3.0
656
+
657
+ ## [1.2.0] - 2019-06-13
658
+
659
+ ### Added
660
+
661
+ - Ability to configure your own type container (@Morozzzko)
662
+
663
+ ```ruby
664
+ types = Dry::Schema::TypeContainer.new
665
+ types.register(
666
+ 'params.trimmed_string',
667
+ Types::String.constructor(&:strip).constructor(&:downcase)
668
+ )
669
+
670
+ Dry::Schema.Params do
671
+ config.types = types
672
+
673
+ require(:name).value(:trimmed_string)
674
+ end
675
+ ```
676
+
677
+ ### Fixed
678
+
679
+ - `filled` macro no longer generates incorrect messages for arrays (issue #151) (@solnic)
680
+ - `filled` macro works correctly with constructor types (@solnic)
681
+ - `filled` works correctly with nested schemas (#149) (@solnic + @timriley)
682
+ - Custom array constructors are no longer discredited by `array` macro (@solnic)
683
+ - `BigDecimal` type is correctly handled by predicate inference (@solnic)
684
+ - Works with latest `dry-logic` which provides the new `respond_to?` predicate (#153) (@flash-gordon)
685
+
686
+ ### Changed
687
+
688
+ - Fixes related to `filled` restored pre-1.1.0 behavior of `:hints` which are again included (@solnic)
689
+ - `filled` no longer uses filter rules to handle empty strings in `Params` (@solnic)
690
+
691
+ [1.2.0]: https://github.com/dry-rb/dry-schema/compare/v1.1.0...v1.2.0
692
+
693
+ ## [1.1.0] - 2019-05-30
694
+
695
+ ### Added
696
+
697
+ - `config.messages.default_locale` for setting...default locale (surprise, surprise) (@solnic)
698
+ - `Config` exposes `predicates` setting too (@solnic)
699
+
700
+ ### Fixed
701
+
702
+ - `filled` macro behavior results in `must be filled` error messages when appropriate - see PR #141 for more information (issue #134) (@solnic)
703
+ - Filter rules no longer cause keys to be added to input (issue #142) (@solnic)
704
+ - Filter rules work now with inheritance (@solnic)
705
+ - Inherited type schemas used by coercion are now properly configured as `lax` type (@solnic)
706
+ - `Config` is now finalized before instantiating schemas and properly dupped when its inherited (@flash-gordon + @solnic)
707
+ - `Config#eql?` works as expected (@solnic)
708
+ - Predicates are properly inferred from array with a member type spec, ie `array[:integer]` results in `array? + each(:integer?)` (issue #140) (@solnic)
709
+
710
+ [1.1.0]: https://github.com/dry-rb/dry-schema/compare/v1.0.3...v1.1.0
711
+
712
+ ## [1.0.3] - 2019-05-21
713
+
714
+ ### Fixed
715
+
716
+ - `Object#hash` is no longer used to calculate cache keys due to a potential risk of having hash collisions (@solnic)
717
+ - Predicate arguments are used again for template cache keys (@solnic)
718
+ - `I18n` messages backend no longer evaluates templates twice (@solnic)
719
+
720
+ [1.0.3]: https://github.com/dry-rb/dry-schema/compare/v1.0.2...v1.0.3
721
+
722
+ ## [1.0.2] - 2019-05-12
723
+
724
+ ### Fixed
725
+
726
+ - Caching message templates uses restricted set of known keys to calculate cache keys (issue #132) (@solnic)
727
+
728
+ [1.0.2]: https://github.com/dry-rb/dry-schema/compare/v1.0.1...v1.0.2
729
+
730
+ ## [1.0.1] - 2019-05-08
731
+
732
+ ### Fixed
733
+
734
+ - Applying `key?` predicate no longer causes recursive calls to `Result#errors` (issue #130) (@solnic)
735
+
736
+ [1.0.1]: https://github.com/dry-rb/dry-schema/compare/v1.0.0...v1.0.1
737
+
738
+ ## [1.0.0] - 2019-05-03
739
+
740
+ ### Fixed
741
+
742
+ - Setting `:any` as the type spec no longer crashes (@solnic)
743
+ - `Result#error?` handles paths to array elements correctly (@solnic)
744
+
745
+ ### Changed
746
+
747
+ - [BREAKING] `Result#to_hash` was removed (@solnic)
748
+
749
+ [1.0.0]: https://github.com/dry-rb/dry-schema/compare/v0.6.0...v1.0.0
750
+
751
+ ## [0.6.0] - 2019-04-24
752
+
753
+ ### Changed
754
+
755
+ - Dependency on `dry-types` was bumped to `~> 1.0` (@solnic)
756
+ - Dependency on `dry-logic` was bumped to `~> 1.0` (@solnic)
757
+ - Dependency on `dry-initializer` was bumped to `~> 3.0` (@solnic)
758
+
759
+ [0.6.0]: https://github.com/dry-rb/dry-schema/compare/v0.5.1...v0.6.0
760
+
761
+ ## [0.5.1] - 2019-04-17
762
+
763
+ ### Fixed
764
+
765
+ - Key map no longer crashes on unexpected input (issue #118) (@solnic)
766
+
767
+ [0.5.1]: https://github.com/dry-rb/dry-schema/compare/v0.5.0...v0.5.1
768
+
769
+ ## [0.5.0] - 2019-04-04
770
+
771
+ ### Added
772
+
773
+ - Support for arbitrary meta-data in messages, ie:
774
+
775
+ ```yaml
776
+ en:
777
+ dry_schema:
778
+ errors:
779
+ filled?:
780
+ text: "cannot be blank"
781
+ code: 123
782
+ ```
783
+
784
+ Now your error hash will include `{ foo: [{ text: 'cannot be blank', code: 123 }] }` (@solnic + @flash-gordon)
785
+ - Support for type specs in `array` macro, ie `required(:tags).array(:integer)` (@solnic)
786
+ - Support for type specs in `each` macro, ie `required(:tags).each(:integer)` (@solnic)
787
+ - Shortcut for defining an array with hash as its member, ie:
788
+
789
+ ```ruby
790
+ Dry::Schema.Params do
791
+ required(:tags).array(:hash) do
792
+ required(:name).filled(:string)
793
+ end
794
+ end
795
+ ```
796
+
797
+ ### Fixed
798
+
799
+ - Inferring predicates doesn't crash when `Any` type is used (@flash-gordon)
800
+ - Inferring type specs when type is already set works correctly (@solnic)
801
+
802
+ ### Changed
803
+
804
+ - [BREAKING] `:monads` extension wraps entire result objects in `Success` or `Failure` (@flash-gordon)
805
+ - When `:hints` are disabled, result AST will not include hint nodes (@solnic)
806
+
807
+ [0.5.0]: https://github.com/dry-rb/dry-schema/compare/v0.4.0...v0.5.0
808
+
809
+ ## [0.4.0] - 2019-03-26
810
+
811
+ ### Added
812
+
813
+ - Schemas are now compatible with procs via `#to_proc` (issue #53) (@solnic)
814
+ - Support for configuring `top_namespace` for localized messages (@solnic)
815
+ - Support for configuring more than one load path for localized messages (@solnic)
816
+ - Support for inferring predicates from arbitrary types (issue #101) (@solnic)
817
+
818
+ ### Fixed
819
+
820
+ - Handling of messages for `optional` keys without value rules works correctly (issue #87) (@solnic)
821
+ - Message structure for `optional` keys with an array of hashes no longer duplicates keys (issue #89) (@solnic)
822
+ - Inferring `:date_time?` predicate works correctly with `DateTime` types (issue #97) (@solnic)
823
+
824
+ ### Changed
825
+
826
+ - [BREAKING] Updated to work with `dry-types 0.15.0` (@flash-gordon)
827
+ - [BREAKING] `Result#{errors,messages,hints}` returns `MessageSet` object now which is an enumerable coercible to a hash (@solnic)
828
+ - [BREAKING] `Messages` backend classes no longer use global configuration (@solnic)
829
+ - [BREAKING] Passing a non-symbol key name in the DSL will raise `ArgumentError` (issue #29) (@solnic)
830
+ - [BREAKING] Configuration for message backends is now nested under `messages` key with following settings:
831
+ - `messages.backend` - previously `messages`
832
+ - `messages.load_paths` - previously `messages_path`
833
+ - `messages.namespace` - previously `namespace`
834
+ - `messages.top_namespace` - **new setting** see above
835
+ - [BREAKING] `Messages::I18n` uses `I18.store_translations` instead of messing with `I18n.load_path` (@solnic)
836
+ - Schemas (`Params` and `JSON`) have nicer inspect (@solnic)
837
+
838
+ [0.4.0]: https://github.com/dry-rb/dry-schema/compare/v0.3.0...v0.4.0
839
+
840
+ ## [0.3.0] - 2018-03-04
841
+
842
+ ### Fixed
843
+
844
+ - Configuration is properly inherited from a parent schema (@skryukov)
845
+ - `Result#error?` returns `true` when a preceding key has errors (@solnic)
846
+ - Predicate inferrer no longer chokes on sum, constructor and enum types (@solnic)
847
+ - Predicate inferrer infers `:bool?` from boolean types (@solnic)
848
+ - Block-based definitions using `array` works correctly (@solnic)
849
+ - Using a disjunction with `array` and `hash` produces correct errors when element validation for array failed (@solnic)
850
+
851
+ ### Changed
852
+
853
+ - Required ruby version was removed from gemspec for people who are stuck on MRI 2.3.x (@solnic)
854
+
855
+ [0.3.0]: https://github.com/dry-rb/dry-schema/compare/v0.2.0...v0.3.0
856
+
857
+ ## [0.2.0] - 2019-02-26
858
+
859
+ ### Added
860
+
861
+ - New `hash` macro which prepends `hash?` type-check and allows nested schema definition (@solnic)
862
+ - New `array` macro which works like `each` but prepends `array?` type-check (@solnic)
863
+
864
+ ### Fixed
865
+
866
+ - Rule name translation works correctly with I18n (issue #52) (@solnic)
867
+ - Rule name translation works correctly with namespaced messages (both I18n and plain YAML) (issue #57) (@solnic)
868
+ - Error messages under namespaces are correctly resolved for overridden names (issue #53) (@solnic)
869
+ - Namespaced error messages work correctly when schemas are reused within other schemas (issue #49) (@solnic)
870
+ - Child schema can override inherited rules now (issue #66) (@skryukov)
871
+ - Hints are correctly generated for disjunction that use type-check predicates (issue #24) (@solnic)
872
+ - Hints are correctly generated for nested schemas (issue #26) (@solnic)
873
+ - `filled` macro respects inferred type-check predicates and puts them in front (@solnic)
874
+ - Value coercion works correctly with re-usable nested schemas (issue #25) (@solnic)
875
+
876
+ ### Changed
877
+
878
+ - [BREAKING] **Messages are now configured under `dry_schema` namespace by default** (issue #38) (@solnic)
879
+ - [BREAKING] Hints are now an optional feature provided by `:hints` extension, to load it do `Dry::Schema.load_extensions(:hints)` (@solnic)
880
+ - [BREAKING] Hints generation was improved in general, output of `Result#messages` and `Result#hints` changed in some cases (@solnic)
881
+ - [BREAKING] `schema` macro no longer prepends `hash?` check, for this behavior use the new `hash` macro (see #31) (@solnic)
882
+ - [BREAKING] Support for MRI < 2.4 was dropped (@solnic)
883
+
884
+ [0.2.0]: https://github.com/dry-rb/dry-schema/compare/v0.1.1...v0.2.0
885
+
886
+ ## [0.1.1] - 2019-02-17
887
+
888
+ ### Added
889
+
890
+ - `Result#error?` supports checking nested errors too ie`result.error?('user.address')` (@solnic)
891
+
892
+ ### Fixed
893
+
894
+ - Fix issues with templates and invalid tokens (issue #27) (@solnic)
895
+ - Fix Ruby warnings (@flash-gordon)
896
+
897
+ [0.1.1]: https://github.com/dry-rb/dry-schema/compare/v0.1.0...v0.1.1
898
+
899
+ ## [0.1.0] - 2019-01-30
900
+
901
+ Initial release.