dry-rb / dry-schema

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

Fixup nested step callbacks & non-hash input handling #353

Closed ojab closed 3 years ago

ojab commented 3 years ago

Fixes #350 Also some drive-by simplifications to Path

dry-v specs are passing with this changes.

ojab commented 3 years ago

Need approval to run CI, tested locally on 2.5.8 & 3.0.1.

ojab commented 3 years ago

Added handling of schemas inside arrays, not sure if there is an issue about that. Will break this to multiple PRs/squash/whatever if needed.

I don't quite like how it works, but dunno if it could be done undoubtly better. IMHO would be easier and more clear to convert key_coercer/filter_schema/value_coercer to underlying type's constructor modifiers instead.

ojab commented 3 years ago

Found/fixed an issue with callbacks for missing optional.schema, also there is a noticeable hit in microbenchmarks after this PR, will take a look sometime this week.

solnic commented 3 years ago

Hey man thanks for this PR, it's awesome that you started tackling this. FYI Path and related things have been on a list of things to refactor/clean-up/improve for a very long time now. I'm more than happy to merge your stuff but please create separate PRs with your work split into refactors and bug fixes. This lib is foundational so we need to be more careful with changes.

solnic commented 3 years ago

@ojab so I guess this can be closed now, right? 🙂

ojab commented 3 years ago

Yeah, remaining part is array handling, I'll prepare a clean new PR with that. Thanks!

solnic commented 3 years ago

@ojab oh damn I thought everything was covered and I already released it 🙂