-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rest: fix error code #190
rest: fix error code #190
Conversation
it should be 40403 and not 40401
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are set of error codes in karapace/kafka_rest_apis/error_codes.py here https://github.com/aiven/karapace/blob/09d426d1db3a41e7009371abffb5da77311e142f/karapace/kafka_rest_apis/error_codes.py#L10
I think using those enum error codes would make sense here, also this PR should explain why 40403 is correct and not 40401 for referencing purposes.
I agree, but ATM I'm not sure how to resolve the naming conflict. The existing names for the error codes were based on how Karapace was using these codes, now we have a However that name does not make sense in the context of a
Ran the test using |
Would it make sense to remove
Yes, I can understand it should be same as Confluent's Schema Registry, but do we have any reference or specifications to follow? Probably not that nor automated test suite to compare. |
AFAIK only the HTTP response codes are documented. https://docs.confluent.io/platform/current/schema-registry/develop/api.html#subjects
I'm not sure if that is what you meant, but I used our integration tests to compare our expected results against their API. Unfortunately we are most likely not covering every case, but that is what caught the difference here.
sure, will do :) |
@@ -199,7 +199,7 @@ async def test_topics(rest_async_client, admin_client): | |||
assert data["partitions"][0]["replicas"][0]["in_sync"], "Replica should be in sync" | |||
res = await rest_async_client.get(f"/topics/{topic_foo}") | |||
assert res.status_code == 404, f"Topic {topic_foo} should not exist, status_code={res.status_code}" | |||
assert res.json()["error_code"] == 40401, "Error code does not match" | |||
assert res.json()["error_code"] == 40403, "Error code does not match" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to update the whole test_rest.py
right now, there is lots of places using the hardcoded constant and not the enum there.
it should be 40403 and not 40401