dry-schema icon indicating copy to clipboard operation
dry-schema copied to clipboard

Coercion and validation for data structures

Results 77 dry-schema issues
Sort by recently updated
recently updated
newest added

Following issue #245, I tried to implement a similar situation inside a `dry-validators` contract, but the following code fails when there is at least one rule involved, see example below...

bug
help wanted

## Describe the bug When using a custom type for example: `ExpirationDate = Types::DateTime.constructor { |value| value.to_time.round.to_datetime }` The constructor does not apply to nested hashes in a schema: ```ruby...

bug
help wanted

Hi, Are there any options to describe schema with dynamic keys? Let's say I have a hash where keys are string numbers: ```ruby { foo: { '1' => { name:...

feature
priority

Currently specifying types in the DSL is not mandatory and by default, whenever you specify a key via `required` or `optional` methods, [a default `Types::Any` is set](https://github.com/dry-rb/dry-schema/blob/master/lib/dry/schema/dsl.rb#L180). This was done...

help wanted
feature

``` SchemaA = Dry::Schema.JSON do config.types = Types::TypeContainer required(:type).value(eql?: "typeA") required(:attributes).value(:hash) do required(:foo).filled(:string) end end SchemaB = Dry::Schema.JSON do config.types = Types::TypeContainer required(:type).value(eql?: "typeB") required(:attributes).value(:hash) do required(:bar).filled(:string) end end class...

## Describe the bug If you validate a nested schema inside an `array` and use an OR, type coercion doesn't work for the inner schema. ## To Reproduce ```ruby it...

bug
help wanted

## Describe the bug Problem during schema validation: On the prerequisites field of the example I want validate that this array contain only hash describe by the previous schemas. Every...

bug
help wanted

## Describe the bug `Object doesn't support #inspect` error is raised when validating an object shown in the example below. ## To Reproduce ``` require 'dry/schema' module Types include Dry::Types()...

bug
help wanted

## Describe the bug Upgraded from version 1.6.1 to 1.7.1 and detected error in my app's tests. Basically, when an empty block is passed, key validation is wrongly validated. I...

bug
help wanted

## Describe the bug `Types.Interface` only returns an error, if the second method in the list is missing, while not in case of first method missing. Let's say, I have...

bug
help wanted