Skip to content

Releases: dry-rb/dry-schema

v1.3.2

01 Aug 09:18
v1.3.2
b00b118
Compare
Choose a tag to compare

Added

  • Support for new predicates: bytesize?, min_bytesize? and max_bytesize? (@bmalinconico)

Compare v1.3.1...v1.3.2

v1.3.1

08 Jul 18:17
v1.3.1
86c9f3a
Compare
Choose a tag to compare

Fixed

  • Result#error? works correctly with nested hashes and arrays (@solnic)
  • :hints extension no longer causes a crash where base messages are generated too (issue #165) (@solnic)

Compare v1.3.0...v1.3.1

v1.3.0

06 Jul 16:18
v1.3.0
b61ffcc
Compare
Choose a tag to compare

Added

  • Automatic predicate inferring for constrained types! (@flash-gordon)

    Types::Name = Types::String.constrained(min_size: 1)
    
    schema = Dry::Schema.define do
      required(:name).value(Types::Name)
    end
    
    schema.(name: '').errors.to_h # => { name: ["size cannot be less than 1"] }
  • Support for redefining re-used schemas (issue #43) (@skryukov)

Fixed

  • Type container is passed down to nested schemas (@flash-gordon)

Compare v1.2.0...v1.3.0

v1.2.0

06 Jul 16:18
Compare
Choose a tag to compare

Added

  • Ability to configure your own type container (@Morozzzko)

Fixed

  • filled macro no longer generates incorrect messages for arrays (issue #151) (@solnic)
  • filled macro works correctly with constructor types (@solnic)
  • filled works correctly with nested schemas (#149) (@solnic + @timriley)
  • BigDecimal type is correctly handled by predicate inference (isssue #158) (@solnic)
  • Works with latest dry-logic which provides the new respond_to? predicate (#153) (@flash-gordon)
  • Custom array constructors are no longer discredited by array macro (@solnic)

Changed

  • ⚠️ Fixes related to filled restored pre-1.1.0 behavior of :hints which are again included for empty strings that get turned into nil in params schemas (@solnic)
  • filled no longer uses filter rules to handle empty strings in Params (@solnic)

Compare v1.1.0...v1.2.0

v1.1.0

30 May 09:01
ba171b8
Compare
Choose a tag to compare

⚠️ This release fixes behavior of filled macro and it may result in different hint messages in some cases.

Added

  • config.messages.default_locale for setting default locale (surprise, surprise) (solnic)
  • Config exposes predicates setting too (solnic)

Fixed

  • filled macro behavior results in must be filled error messages when appropriate - see PR #141 for more information (issue #134) (solnic)
  • Filter rules no longer cause keys to be added to input (issue #142) (solnic)
  • Filter rules work now with inheritance (solnic)
  • Inherited type schemas used by coercion are now properly configured as lax type (solnic)
  • Config is now finalized before instantiating schemas and properly dupped when its inherited (flash-gordon + solnic)
  • Config#eql? works as expected (solnic)
  • Predicates are properly inferred from array with a member type spec, ie array[:integer] results in array? + each(:integer?) (issue #140) (solnic)

Compare v1.0.3...v1.1.0

v1.0.3

30 May 09:00
v1.0.3
95e3fee
Compare
Choose a tag to compare

Fixed

  • Object#hash is no longer used to calculate cache keys due to a potential risk of having hash collisions (solnic)
  • Predicate arguments are used again for template cache keys (solnic)
  • I18n messages backend no longer evaluates templates twice (solnic)

Compare v1.0.2...v1.0.3

v1.0.2

12 May 16:28
v1.0.2
951488f
Compare
Choose a tag to compare

Fixed

  • Caching message templates uses restricted set of known keys to calculate cache keys (issue #132) (solnic)

Compare v1.0.1...v1.0.2

v1.0.1

08 May 10:53
v1.0.1
bf3fbc2
Compare
Choose a tag to compare

Fixed

  • Applying key? predicate no longer causes recursive calls to Result#errors (issue #130) (solnic)

Compare v1.0.0...v1.0.1

v1.0.0

03 May 11:05
v1.0.0
b9bb425
Compare
Choose a tag to compare

Changed

  • [BREAKING] Result#to_hash was removed (solnic)

Fixed

  • Setting :any as the type spec no longer crashes (solnic)
  • Result#error? handles paths to array elements correctly (solnic)

Compare v0.6.0...v1.0.0

v0.6.0

03 May 11:04
v0.6.0
f1c27bb
Compare
Choose a tag to compare
v0.6.0 Pre-release
Pre-release

Changed

  • Dependency on dry-types was bumped to ~> 1.0 (solnic)
  • Dependency on dry-logic was bumped to ~> 1.0 (solnic)
  • Dependency on dry-initializer was bumped to ~> 3.0 (solnic)

Compare v0.5.1...v0.6.0