Skip to content

v0.5.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@solnic solnic released this 04 Apr 10:05
v0.5.0
4c5d167

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 array macro, ie required(:tags).array(:integer) (solnic)

  • Support for type specs in each macro, ie required(: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 Any type is used (flash-gordon)
  • Inferring type specs when type is already set works correctly (solnic)

Changed

  • [BREAKING] :monads extension wraps entire result objects in Success or Failure (flash-gordon)
  • When :hints are disabled, result AST will not include hint nodes (solnic)

Compare v0.4.0...v0.5.0