Skip to content

Conversation

@zw2582
Copy link

@zw2582 zw2582 commented Jun 7, 2018

Join the defaults rule for default settings, and get the parameters for successful verification

@emsifa
Copy link
Member

emsifa commented Jun 7, 2018

It is nice idea. But by looking on your code, I think it would cause an unexpected result, because you just set validata, and not using those default values for rule checking.

And I think getValidata is not good for naming and also can be miss understanding because it returns all validated data including invalid data. It should be named getValidatedData.

Or we can separate valid data and invalid data by set them after finish checking an attribute.

Let me know if you need help for this 😉

@zw2582
Copy link
Author

zw2582 commented Jun 8, 2018

Yes, I have looked for a lot of validator frameworks. Your is the best, however, the default rule is missing, and the validated parameters cannot be obtained.This is very important and convenient because it can filter out some unsafe paramters, If possible, I hope you use your way to perfect this one

@zw2582
Copy link
Author

zw2582 commented Jun 8, 2018

In my scene, I don't need to separate valid data and invalid data. Because all data is valid data if validation is pass, If failed, I don't need any

@emsifa
Copy link
Member

emsifa commented Jun 8, 2018

I just fix defaults functionality and add 3 methods:

  • getValidatedData(): get all validated data.
  • getValidData(): get only valid data.
  • getInvalidData(): get only invalid data.

I will write documentation for it soon.

@emsifa emsifa merged commit 9e252c0 into rakit:master Jun 8, 2018
@zw2582
Copy link
Author

zw2582 commented Jun 9, 2018

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants