Format checker deepcopy to shallowcopy

This commit is contained in:
p1c2u 2021-02-12 23:58:30 +00:00
parent 501694c403
commit a16162ffa0

View file

@ -1,4 +1,4 @@
from copy import deepcopy from copy import copy
import warnings import warnings
from openapi_schema_validator import OAS30Validator, oas30_format_checker from openapi_schema_validator import OAS30Validator, oas30_format_checker
@ -89,7 +89,7 @@ class SchemaUnmarshallersFactory(object):
return OAS30Validator(schema.__dict__, **kwargs) return OAS30Validator(schema.__dict__, **kwargs)
def _get_format_checker(self): def _get_format_checker(self):
fc = deepcopy(oas30_format_checker) fc = copy(oas30_format_checker)
for name, formatter in self.custom_formatters.items(): for name, formatter in self.custom_formatters.items():
fc.checks(name)(formatter.validate) fc.checks(name)(formatter.validate)
return fc return fc