Closed jacob2221 closed 6 hours ago
Hello, as the README says:
Note: the Validator class is immutable and thread-safe, so you don't have to create a new one for each validation, it is enough to configure it only once.
On the other hand it is also cheap to create an instance, so if you want, there is no issue with creating a new instance for each validation, and expose only the Schema object as a spring bean.
Thank you
Hi,
I am planning to create a custom validator with lenient flag turned on for primitives as shown in the code below -
I am using spring boot. Can I create one instance of this validator and use it across the application or do you recommend creating new Validator each time I need to apply schema validation?