You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently z-schema uses one shared storage for all custom formats. There are two possible errors:
Different instances of validator can't use different formats with the same name.
User can unexpectedly get format which was registered in another npm module, because npm v3 try to install dependencies without nesting.
Suggestion
Add solution when custom format can be registered per validator instance.
Deprecate global registration of custom formats. If user wants to use same format in different validator instances, it can safely create factory:
functioncreateSchemaValidator(){varvalidator=newZSchema();// Register common formatsvalidator.registerFormat(...);returnvalidator;}varvalidator1=createSchemaValidator();varvalidator2=createSchemaValidator();
The text was updated successfully, but these errors were encountered:
Problem
Currently
z-schema
uses one shared storage for all custom formats. There are two possible errors:npm v3
try to install dependencies without nesting.Suggestion
Add solution when custom format can be registered per validator instance.
Deprecate global registration of custom formats. If user wants to use same format in different validator instances, it can safely create factory:
The text was updated successfully, but these errors were encountered: