From 2b218d187e00ea7058bc218967893d82332302a1 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 ef778b008..c6d122a6e 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)