fastjsonschema: don't touch my data please!

I'm sure this can be useful, but since I validate before storing, this is just
a ReallyBadIdea(TM). For one, it makes it so that running with different settings
of VALIDATE_ON_DIGEST leads to different data in the DB
This commit is contained in:
Klaas van Schelven
2024-09-19 13:46:13 +02:00
parent f90ce561a1
commit 8f0985cbe5

View File

@@ -158,7 +158,7 @@ class BaseIngestAPIView(View):
# the schema is loaded once and cached on the class (it's ~200ms)
# use_formats=False for "uint64", see https://github.com/horejsek/python-fastjsonschema/issues/108
if not hasattr(cls, "_event_validator"):
cls._event_validator = fastjsonschema.compile(get_schema(), use_formats=False)
cls._event_validator = fastjsonschema.compile(get_schema(), use_formats=False, use_default=False)
# known fields that are not part of the schema (and that we don't want to validate)
data_to_validate = {k: v for k, v in data.items() if k != "_meta"}