-
Notifications
You must be signed in to change notification settings - Fork 357
Custom function #493
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
Comments
There is not. What are you trying to achieve? If you can explain what you want to do, we may be able to suggest an alternative method. |
@ravipxm If you want to try to archive this you need to do the following:
But actually I do not recommend this to you. First of all you should take a look to a different schema validator, because this Validator is nice but not very extendable, due the consequent violation of SOLID principles. This leads to this "inheritance incest" I've described above. @erayd If I could combine the "e-mail address format constraint" and a "e-mail address is not registred constraint" in a composite design pattern, so that I'm able to handle the validation in one step. So there would be no need to do a second instance for "verifing" the data plausibility. The same could be needed for "is email address registred constraint" for login and a forgot password feature or to check relations. But as I said before, this package is not very extensible for this. |
@ravipxm in an attempt to cleanup this repo we are trying to filter the issues and see which ones might be closed. Is it safe to assume this is a rather old issue, which sadly was left unanswered, and can be closed? Feel free to close it yourself with some comments if helpful. @codejunkie84 from your comments I can see you want to do some contextual validation where you would have some specific validations you would like to apply as callback. From the perspective of the library this would seem out of scope as it's goal is to validate the JSON schema. And as it is just keeping up with only doing that is already a decent challenge. What I believe @erayd is hinting at is see how you can use a validated JSON document for validation down the line. As an example in some projects I've been part of we use Symfony and have a class which resembles the JSON structure and do contextual validation using the |
Is there a way to define custom validation function?
Thanks for this amazing lib
The text was updated successfully, but these errors were encountered: