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

Improve error message when collection name omitted #808

Merged
merged 13 commits into from
Jan 22, 2024
Merged

Conversation

Yuqi-Du
Copy link
Contributor

@Yuqi-Du Yuqi-Du commented Jan 18, 2024

What this PR does:
JSON API should detect the mismatch of provided command with url path.

e.g. 1
{{base_json_url}}{{json_api}}/namespace

{
    "find":{}
}

should prompt No 'find' command found as NamespaceCommand

e.g. 2
{{base_json_url}}{{json_api}}/namespace/collection

{
    "randomGuy":{}
}

should prompt No 'randomGuy' command found as CollectionCommand

e.g. 3
{{base_json_url}}{{json_api}}/namespace/collection

{
    "createNamespace":{}
}

should prompt No 'createNamespace' command found as CollectionCommand

Which issue(s) this PR fixes:
Fixes #800

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@Yuqi-Du Yuqi-Du marked this pull request as ready for review January 19, 2024 00:59
@Yuqi-Du Yuqi-Du requested a review from a team as a code owner January 19, 2024 00:59
Copy link
Contributor

@tatu-at-datastax tatu-at-datastax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The only thing is that I think (as per note I added) it'd make sense to extract DeserializationProblemHandler to reuse in unit test.

@Yuqi-Du Yuqi-Du merged commit d195971 into main Jan 22, 2024
2 checks passed
@Yuqi-Du Yuqi-Du deleted the unmatch_command_type branch January 22, 2024 20:50
Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message when collection name omitted
3 participants