Releases: dry-rb/dry-schema
Releases · dry-rb/dry-schema
v1.0.1
v1.0.0
Changed
- [BREAKING]
Result#to_hashwas removed (solnic)
Fixed
- Setting
:anyas the type spec no longer crashes (solnic) Result#error?handles paths to array elements correctly (solnic)
v0.6.0
Changed
- Dependency on
dry-typeswas bumped to~> 1.0(solnic) - Dependency on
dry-logicwas bumped to~> 1.0(solnic) - Dependency on
dry-initializerwas bumped to~> 3.0(solnic)
v0.5.1
v0.5.0
Added
-
Support for arbitrary meta-data in messages, ie:
en: dry_schema: errors: filled?: text: "cannot be blank" code: 123
Now your error hash will include
{ foo: [{ text: 'cannot be blank', code: 123 }] }(solnic + flash-gordon) -
Support for type specs in
arraymacro, ierequired(:tags).array(:integer)(solnic) -
Support for type specs in
eachmacro, ierequired(:tags).each(:integer)(solnic) -
Shortcut for defining an array with hash as its member, ie:
Dry::Schema.Params do required(:tags).array(:hash) do required(:name).filled(:string) end end
Fixed
- Inferring predicates doesn't crash when
Anytype is used (flash-gordon) - Inferring type specs when type is already set works correctly (solnic)
Changed
- [BREAKING]
:monadsextension wraps entire result objects inSuccessorFailure(flash-gordon) - When
:hintsare disabled, result AST will not include hint nodes (solnic)
v0.4.0
Added
- Schemas are now compatible with procs via
#to_proc(issue #53) (solnic) - Support for configuring
top_namespacefor localized messages (solnic) - Support for configuring more than one load path for localized messages (solnic)
- Support for inferring predicates from arbitrary types (issue #101) (solnic)
Fixed
- Handling of messages for
optionalkeys without value rules works correctly (issue #87) (solnic) - Message structure for
optionalkeys with an array of hashes no longer duplicates keys (issue #89) (solnic) - Inferring
:date_time?predicate works correctly withDateTimetypes (issue #97) (solnic)
Changed
- [BREAKING] Updated to work with
dry-types 0.15.0(flash-gordon) - [BREAKING]
Result#{errors,messages,hints}returnsMessageSetobject now which is an enumerable coercible to a hash (solnic) - [BREAKING]
Messagesbackend classes no longer use global configuration (solnic) - [BREAKING] Passing a non-symbol key name in the DSL will raise
ArgumentError(issue #29) (solnic) - [BREAKING] Configuration for message backends is now nested under
messageskey with following settings:messages.backend- previouslymessagesmessages.load_paths- previouslymessages_pathmessages.namespace- previouslynamespacemessages.top_namespace- new setting see above
- [BREAKING]
Messages::I18nusesI18.store_translationsinstead of messing withI18n.load_path(solnic) - Schemas (
ParamsandJSON) have nicer inspect (solnic)
v0.3.0
Fixed
- Configuration is properly inherited from a parent schema (skryukov)
Result#error?returnstruewhen a preceding key has errors (solnic)- Predicate inferrer no longer chokes on sum, constructor and enum types (solnic)
- Predicate inferrer infers
:bool?from boolean types (solnic) - Block-based definitions using
arrayworks correctly (solnic) - Using a disjunction with
arrayandhashproduces correct errors when element validation for array failed (solnic)
Changed
- Required ruby version was removed from gemspec for people who are stuck on MRI 2.3.x (solnic)
v0.2.0
Added
- New
hashmacro which prependshash?type-check and allows nested schema definition (solnic) - New
arraymacro which works likeeachbut prependsarray?type-check (solnic)
Fixed
- Rule name translation works correctly with I18n (issue #52) (solnic)
- Rule name translation works correctly with namespaced messages (both I18n and plain YAML) (issue #57) (solnic)
- Error messages under namespaces are correctly resolved for overridden names (issue #53) (solnic)
- Namespaced error messages work correctly when schemas are reused within other schemas (issue #49) (solnic)
- Child schema can override inherited rules now (issue #66) (skryukov)
- Hints are correctly generated for disjunction that use type-check predicates (issue #24) (solnic)
- Hints are correctly generated for nested schemas (issue #26) (solnic)
filledmacro respects inferred type-check predicates and puts them in front (solnic)- Value coercion works correctly with re-usable nested schemas (issue #25) (solnic)
Changed
- [BREAKING] Messages are now configured under
dry_schemanamespace by default (issue #38) (solnic) - [BREAKING] Hints are now an optional feature provided by
:hintsextension, to load it doDry::Schema.load_extensions(:hints)(solnic) - [BREAKING] Hints generation was improved in general, output of
Result#messagesandResult#hintschanged in some cases (solnic) - [BREAKING]
schemamacro no longer prependshash?check, for this behavior use the newhashmacro (see #31) (solnic) - [BREAKING] Support for MRI < 2.4 was dropped (solnic)
v0.1.1
Initial release
v0.1.0 Version 0.1.0