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

feat(json): support JSON.GET pretty print options #1832

Merged
merged 6 commits into from Sep 24, 2023

Conversation

iko1
Copy link
Collaborator

@iko1 iko1 commented Sep 10, 2023

Fixes: #848

Signed-off-by: iko1 <me@remotecpp.dev>
@iko1 iko1 force-pushed the feature/add-opt-param-json-get branch 2 times, most recently from c5a8076 to 1342e3d Compare September 17, 2023 17:13
@iko1 iko1 marked this pull request as ready for review September 17, 2023 17:14
@iko1
Copy link
Collaborator Author

iko1 commented Sep 17, 2023

@romange, there is a way to exclude the patch file in this commit from the clang-format validator?

Signed-off-by: iko1 <me@remotecpp.dev>
@iko1 iko1 force-pushed the feature/add-opt-param-json-get branch from 1342e3d to 005acf5 Compare September 17, 2023 17:19
@romange
Copy link
Collaborator

romange commented Sep 18, 2023

Hey @iko1 thanks for fixing this issue!

Yes, you can check .pre-commit-config.yaml file and add patches directory to the exclude filter.

@@ -110,7 +110,9 @@ TEST_F(JsonFamilyTest, SetGetFromPhonebook) {
EXPECT_EQ(resp, R"(["New York","NY","21 2nd Street","10021-3100"])");

resp = Run({"JSON.GET", "json", "$.firstName", "$.age", "$.lastName"});
EXPECT_EQ(resp, R"({"$.age":[27],"$.firstName":["John"],"$.lastName":["Smith"]})");
EXPECT_EQ(
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you please add few tests covering those cases?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reverted the change that affected the "JSON.GET" command when formatting args are not supplied with it.
Can you elaborate on which tests are currently missing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I added a few tests based on the previous JSON.GET cases that cover the feature functionality.

Signed-off-by: iko1 <me@remotecpp.dev>
@iko1 iko1 force-pushed the feature/add-opt-param-json-get branch from edb065e to 22f65da Compare September 21, 2023 07:32
@iko1 iko1 force-pushed the feature/add-opt-param-json-get branch 2 times, most recently from f1a63d0 to 64e93bb Compare September 21, 2023 07:40
Signed-off-by: iko1 <me@remotecpp.dev>
@iko1 iko1 force-pushed the feature/add-opt-param-json-get branch from 64e93bb to 123cc97 Compare September 21, 2023 07:42
Signed-off-by: iko1 <me@remotecpp.dev>
@iko1 iko1 requested a review from romange September 24, 2023 12:42
@romange romange merged commit 19783fa into dragonflydb:main Sep 24, 2023
7 checks passed
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.

Support JSON.GET Pretty Print Options [INDENT indent] [NEWLINE newline] [SPACE space]
2 participants