-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: create new transform
method that both maps and validates values
#87
Comments
Can this not be done using |
Ah! I didn't know about map. I think that probably does fit the bill. Thanks! |
Actually, scratch that, there are a few essential features that are missing:
I think if we were to implement this new exception type (10 lines of code + a few for catching in the right spot), then I could use it from within |
See #93, where if using There are a few changes that need to be made around validation I feel as well. Can you create a PR for us? |
Sure. Are the approved issues tagged or anything to make them recognizable? Just started this branch to track the work. |
Probably, but Nate still has not made me a maintainer, so I don't manage tags, so I just keep track in my head. |
Ah, ok. Well I guess there aren't a ton. I'll just read through the open issues and see if I can assemble a good solution for the ones that speak to validation. Will see if I can dig in this weekend. |
Instead of Issue #86, perhaps it makes more sense to implement a
transform
method that handles both validation and value mapping.I have certain options that accept simple json strings as values, for example. These will require both a transformation from string to php array, and also certain object-specific validations.
To handle this well, I'll need the ability to deliver fine-grained error messages and also the ability to parse the value only once, rather than parsing the value for validation, then parsing again for mapping.
Here's how I see this working:
The text was updated successfully, but these errors were encountered: