diff --git a/src/karapace/routers/requests.py b/src/karapace/routers/requests.py index 330488c68..8400f629d 100644 --- a/src/karapace/routers/requests.py +++ b/src/karapace/routers/requests.py @@ -47,7 +47,7 @@ class SchemaResponse(BaseModel): class SchemasResponse(BaseModel): schema_str: str = Field(alias="schema") subjects: list[Subject] | None = None - schema_type: SchemaType | None = None + schema_type: SchemaType | None = Field(alias="schemaType", default=None) references: list[Any] | None = None # TODO: typing maxId: int | None = None @@ -57,7 +57,7 @@ class SchemaListingItem(BaseModel): schema_str: str = Field(alias="schema") version: int schema_id: int = Field(alias="id") - schemaType: str + schema_type: SchemaType | None = Field(alias="schemaType", default=None) references: list[Any] | None @@ -97,5 +97,5 @@ class SubjectSchemaVersionResponse(BaseModel): schema_id: int = Field(alias="id") schema_str: str = Field(alias="schema") references: list[Any] | None = None - schema_type: str | None = None + schema_type: SchemaType | None = Field(alias="schemaType", default=None) compatibility: str | None = None diff --git a/src/karapace/schema_registry_apis.py b/src/karapace/schema_registry_apis.py index c25cd735c..56e79243c 100644 --- a/src/karapace/schema_registry_apis.py +++ b/src/karapace/schema_registry_apis.py @@ -285,7 +285,7 @@ def _has_subject_with_id() -> bool: return SchemasResponse( schema=schema_str, subjects=subjects, - schema_type=schema_type, + schemaType=schema_type, references=references, maxId=maxId, ) @@ -489,7 +489,7 @@ async def subject_version_get( id=subject_data["id"], schema=subject_data["schema"], references=subject_data.get("references", None), - schema_type=subject_data.get("schemaType", None), + schemaType=subject_data.get("schemaType", None), compatibility=None, # Do not return compatibility from this endpoint. ) except (SubjectNotFoundException, SchemasNotFoundException):