Skip to content

Commit

Permalink
fix: fixed schema response to have schemaType
Browse files Browse the repository at this point in the history
  • Loading branch information
jjaakola-aiven committed Nov 29, 2024
1 parent 493f0a9 commit 232cd94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/karapace/routers/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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


Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/karapace/schema_registry_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 232cd94

Please sign in to comment.