I have a django model with a JSONField (django.contrib.postgres.fields.JSONField) Is there any way that I can validate model data against a json schema file?
JSONField
That's what the Model.clean() method is for (see docs). Example:
Model.clean()
class MyData(models.Model): some_json = JSONField() ... def clean(self): if not is_my_schema(self.some_json): raise ValidationError('Invalid schema.')