Skip to content

Releases: dry-rb/dry-schema

v1.15.0

09 Jan 06:40
v1.15.0
3d4073f

Choose a tag to compare

Changed

  • Set mimimum Ruby version to 3.2 (@timriley)
  • Support UUID v6, v7 and v8 predicates (:uuid_v6?, :uuid_v7? and :uuid_v8?). (@illiatdesdindes in #509)
  • Support size?, format?, true? and false? predicates when generating JSON schemas. (@cramt in #499)
  • Allow symbols to be given for top_namespace setting. (@unused in #491)

Fixed

  • Support intersection types (created with & operator) in schema definitions. (@baweaver in #496)

    Now works without errors:

    intersection_type =
      Types::Hash.schema(a: Types::String) & 
      (Types::Hash.schema(b: Types::String) | Types::Hash.schema(c: Types::String))
    
    schema = Dry::Schema.Params do
      required(:body).value(intersection_type)
    end
    
    schema.call(body: {a: "test", b: "value"}) # passes
    schema.call(body: {b: "value"})            # fails - missing 'a'
  • JSON schema generation now properly handles Dry::Struct instances wrapped in constructors. (@baweaver in #497)

    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.

    Before/after:

    # Before: Missing struct properties
    Dry::Schema.Params do 
      required(:address).value(Address.constructor(&:itself)) 
    end.json_schema
    # => {:properties=>{:address=>{:type=>"object"}}} # No properties
    
    # After: Full struct schema included  
    Dry::Schema.Params do 
      required(:address).value(Address.constructor(&:itself)) 
    end.json_schema
    # => {:properties=>{:address=>{:type=>"object", :properties=>{:street=>{...}}}}} # Properties included
  • JSON schema generation now correctly uses minItems/maxItems for array size predicates instead of minLength/maxLength. (@baweaver in #498)

  • Show correct index in errors when validating unexpected keys in arrays. (@katafrakt in #510)

  • Support validating nested arrays when using config.validate_keys = true. (@misdoro in #508)

  • Fix handling of i18n messages from proc/lambda-produced hashes. (@rrothenberger in #493)

  • Fix error arising when generating errors when a key is repeated in a nested schema. (@jacob-carlborg in #503)

  • Fix method call typo in Dry::Schema::Trace#respond_to_missing?. (@flash-gordon in 13ddb51)

Compare v1.14.1 ... v1.15.0

v1.14.1

03 Mar 08:43
v1.14.1
3d7a75a

Choose a tag to compare

Fixed

Compare v1.14.0...v1.14.1

v1.14.0

06 Jan 20:50
v1.14.0

Choose a tag to compare

Added

  • Better support for sets in excluded_from? and included_in? predicates (via #480) (@flash-gordon)

Fixed

Changed

Compare v1.13.4...v1.14.0

v1.13.4

22 May 20:33
v1.13.4

Choose a tag to compare

Added

Fixed

  • Fix json-schema type of objects nested under arrays (issue #400 fixed via #462) (@tomgi)

Changed

Compare v1.13.3...v1.13.4

v1.13.3

26 Aug 13:17
v1.13.3
27f1faf

Choose a tag to compare

Fixed

Compare v1.13.2...v1.13.3

v1.13.2

31 May 07:17
v1.13.2

Choose a tag to compare

Fixed

Compare v1.13.1...v1.13.2

v1.13.1

07 Apr 06:28
v1.13.1
64d370d

Choose a tag to compare

Fixed

Compare v1.13.0...v1.13.1

v1.13.0

24 Nov 18:36
v1.13.0
534c8d9

Choose a tag to compare

Fixed

  • Change required metadata back to true to fix regressions (issue #438 fixed via 439) (@robhanlon22)
  • Compatibility with dry-configurable 1.0.1 (@flash-gordon)
  • Warnings about using pattern matching on Ruby 2.7 (issue #441 fixed via #442) (@r7kamura)
  • Make message cache fully thread-safe (via #440) (@mensfeld)

Compare v1.12.0...v1.13.0

v1.12.0

04 Nov 17:09
v1.12.0
d39a8b3

Choose a tag to compare

Changed

  • This version depends on dry-core 1.0 and dry-configurable 1.0 (@flash-gordon)

Compare v1.11.3...v1.12.0

v1.11.3

21 Oct 17:14
v1.11.3

Choose a tag to compare

Fixed

  • Fixed array(sum_type) syntax which was a regression introduced in 1.10.0 (issue #436 fixed via #437) (@solnic)

Compare v1.11.2...v1.11.3