From c252a2404c44a86a33fc91a6a63ccd5692189fec Mon Sep 17 00:00:00 2001 From: Enis Mustafaj Date: Wed, 30 Oct 2024 14:37:21 +0100 Subject: [PATCH] fix: Test Compatibility returns true when schema missing To make the api compatible with Confluent Schema Registry, testing the schema compatibility should return "true" wheneber the subject, schema or the version is missing --- src/karapace/schema_registry_apis.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/karapace/schema_registry_apis.py b/src/karapace/schema_registry_apis.py index fbb8f5a0c..2ba489b53 100644 --- a/src/karapace/schema_registry_apis.py +++ b/src/karapace/schema_registry_apis.py @@ -1354,14 +1354,8 @@ def get_old_schema(self, subject: Subject, version: Version, content_type: str) except InvalidVersion: self._invalid_version(content_type, version) except (VersionNotFoundException, SchemasNotFoundException, SubjectNotFoundException): - self.r( - body={ - "error_code": SchemaErrorCodes.VERSION_NOT_FOUND.value, - "message": f"Version {version} not found.", - }, - content_type=content_type, - status=HTTPStatus.NOT_FOUND, - ) + self.r({"is_compatible": True}, content_type) + old_schema_type = self._validate_schema_type(content_type=content_type, data=old) try: old_references = old.get("references", None)