dry-schema 1.16.0 released

Added

Changed

  • In JSON Schema output, represent values with an eql? constraint as “const” values. (@adamransom in #514)
    require "dry/schema"
    Dry::Schema.load_extensions(:json_schema)
    
    schema = Dry::Schema.JSON do
      required(:version).value(:integer, eql?: 1)
    end
    
    schema.json_schema
    # => {"$schema": "http://json-schema.org/draft-06/schema#", type: "object", properties: {version: {type: "integer", const: 1}}, required: ["version"]}
    

Fixed

  • In JSON Schema output, fix representation of arrays that are a combinations of schemas. (@adamransom in #516)
  • Avoid mutation of arguments given to Dry::Schema::Messages::I18n#get. (@flash-gordon in 51d48b6)

Compare v1.15.0 … v1.16.0


View release on GitHub