Skip to content

various missing predicates for JSON schema #500

@cramt

Description

@cramt

Describe the bug

A few predicates from dry-logic is missing in the json_schema compiler

To Reproduce

require "dry-types"
require "dry-schema"
Dry::Schema.load_extensions(:json_schema)

module Types
  include Dry.Types()
end

puts (Dry::Schema.Params do
  required(:_).value(Types::Hash.schema(
                       size: Types::Array.constrained(size: 5),
                       format: Types::String.constrained(format: /[A-Z]{2}/),
                       bool: Types::Bool,
                     ))
end).json_schema

Expected behavior

To not error and return the correct schema

My environment

  • Affects my production application: yes, but i've just monkeypatched it for now
  • Ruby version: 3.3.9
  • OS: NixOS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions