From 8f0985cbe5b1e32d8d93a68d69239fc6c44f4dc8 Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Thu, 19 Sep 2024 13:46:13 +0200 Subject: [PATCH] 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 --- ingest/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ingest/views.py b/ingest/views.py index 17d9efa..8a25688 100644 --- a/ingest/views.py +++ b/ingest/views.py @@ -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"}