Skip to content

Commit

Permalink
Merge pull request #705 from Aiven-Open/fix-references-check-schema-r…
Browse files Browse the repository at this point in the history
…egistered

Fix references support in check schema registered endpoint
  • Loading branch information
aiven-anton authored Aug 30, 2023
2 parents 955c297 + 2c0204b commit abc21a6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion karapace/schema_registry_apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,10 @@ async def subjects_schema_post(
for schema_version in sorted(subject_data.values(), key=lambda item: item.version, reverse=True):
try:
parsed_typed_schema = ParsedTypedSchema.parse(
schema_version.schema.schema_type, schema_version.schema.schema_str
schema_version.schema.schema_type,
schema_version.schema.schema_str,
references=references,
dependencies=new_schema_dependencies,
)
except InvalidSchema as e:
failed_schema_id = schema_version.schema_id
Expand Down
13 changes: 13 additions & 0 deletions tests/integration/test_schema_protobuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,19 @@ async def test_protobuf_schema_references(registry_async_client: Client) -> None
assert res.status_code == 200

assert "id" in res.json()
customer_id = res.json()["id"]

# Check if the schema has now been registered under the subject
res = await registry_async_client.post(
"subjects/customer",
json={"schemaType": "PROTOBUF", "schema": customer_schema, "references": customer_references},
)
assert res.status_code == 200
assert "subject" in res.json()
assert "id" in res.json()
assert customer_id == res.json()["id"]
assert "version" in res.json()
assert "schema" in res.json()

original_schema = """
|syntax = "proto3";
Expand Down

0 comments on commit abc21a6

Please sign in to comment.