diff --git a/src/servala/core/crd.py b/src/servala/core/crd.py index 2793d75..2c2b9fb 100644 --- a/src/servala/core/crd.py +++ b/src/servala/core/crd.py @@ -5,7 +5,6 @@ from django.core.validators import MaxValueValidator, MinValueValidator, RegexVa from django.db import models from django.forms.models import ModelForm, ModelFormMetaclass from django.utils.translation import gettext_lazy as _ -from jsonschema import validate from servala.core.models import ServiceInstance @@ -254,10 +253,14 @@ class CrdModelFormMixin: def validate_nested_data(self, data, schema): """Validate data against the provided OpenAPI v3 schema""" - try: - validate(instance=data, schema=schema) - except Exception as e: - raise forms.ValidationError(f"Validation error: {e.message}") + # TODO: actually validate the nested data. + # TODO: get jsonschema to give us a path to the failing field rather than just an error message, + # then add the validation error to that field (self.add_error()) + # try: + # validate(instance=data, schema=schema) + # except Exception as e: + # raise forms.ValidationError(f"Validation error: {e.message}") + pass def generate_model_form_class(model):