Skip to content
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

Non-standard response code when obtaining a non-existing version of schema or document #403

Closed
ThomasJejkal opened this issue Dec 1, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ThomasJejkal
Copy link
Contributor

Describe the bug
Trying to obtain a schema or document record or downloading their contents for a version which does not exist results in HTTP 400 and a message like ID '27c4bd97-1b5e-46de-a548-6ec44a6edc22' or version '3' doesn't exist!

There are several issues with this behavior:

  1. If something is not found, HTTP 404 should be returned. HTTP 400 is typically used if there are syntactic issues with the request, e.g., an invalid body, but in that case, the request itself is totally fine.
  2. The message is not clear enough about the reason (for no reason ;-)). If the user provides an invalid ID, MetaStore responds with HTTP 404 and a message like Data resource with identifier 27c4bd97-1b5e-46de-a548-6ec44a6edc2 was not found. Therefore, the message in our case could be much more specific, e.g., Version 3 of resource XYZ does not exist.
  3. While testing out the response for case 2 I saw the mentioning of "Data resource", which is probably due to the fact, that this error is thrown by the repo-core part, whereas the other scenario is handled by MetaStore itself. It could be misleading for the user to mix terminologies (metadata record, schema record vs. data resource), but I'm not sure how to cope with this with the current architecture.

Expected behavior
Regarding the main issue I would suggest to change the response to HTTP 404 with a message like Version 3 of resource XYZ does not exist.

@ThomasJejkal ThomasJejkal added the bug Something isn't working label Dec 1, 2023
@VolkerHartmann VolkerHartmann self-assigned this Dec 5, 2023
Copy link
Contributor

github-actions bot commented Dec 5, 2023

github-actions bot added a commit that referenced this issue Dec 5, 2023
VolkerHartmann added a commit to VolkerHartmann/metastore2 that referenced this issue Dec 6, 2023
VolkerHartmann added a commit to VolkerHartmann/metastore2 that referenced this issue Dec 6, 2023
@github-actions github-actions bot closed this as completed Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants