dry-rb / dry-schema

Coercion and validation for data structures
https://dry-rb.org/gems/dry-schema
MIT License
424 stars 110 forks source link

Question marks in key names no longer valid? #456

Open camerondrysdale opened 1 year ago

camerondrysdale commented 1 year ago

We use the Config gem: https://github.com/rubyconfig/config for our Rails application and validate using Dry Schema.

We've recently updated the gem to the latest version and noticed that keys with question marks in them like this:

required(:s3_uploads?).filled(:bool?)

Now raise the error:

s3_uploads?: is missing

Even though we have this key in our Settings.yml like this:

s3_uploads?: true

In order to fix this, we've had to remove the ? from all our keys that contain them so it becomes just s3_uploads, which looks to have all resolved the validation errors we were seeing, but has also meant we've had to update all the uses of Settings.s3_uploads? in our code as well... and we preferred to have the ? for the booleans to be inline with similar Ruby methods.

Has something changed in Dry Schema that means ? are not valid keys anymore?