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

[US-642] implement simple queries #2

Merged
merged 9 commits into from
Feb 4, 2022

Conversation

piotrdytkowski
Copy link
Owner

No description provided.

@piotrdytkowski piotrdytkowski force-pushed the US-642-implement-simple-queries branch from 9a9391a to 2320805 Compare January 28, 2022 09:36
@piotrdytkowski piotrdytkowski force-pushed the US-642-implement-simple-queries branch from 304bc68 to 691b7be Compare January 28, 2022 12:34
.replaceAll("(\\w)\\?", "$1#")
.split("#", -1);
if (pointerAndQuery.length > 2) {
// TODO use different exception
Copy link

@lukaszgawel lukaszgawel Feb 2, 2022

Choose a reason for hiding this comment

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

when this TODO will be resolved?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Immediately :D used JsonPatchException here, with a new custom message, thanks

final DocumentContext nodeContext = JsonPath.parse(node.deepCopy());

final JsonNode parentNode = nodeContext.read(jsonPath);
final JsonNode parentNode = nodeContext.read(pathToParent);
Copy link

Choose a reason for hiding this comment

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

parentNode is confusing name as this can be list of nodes

if ("/".equals(path)) {
return "$";
}
final String jsonPath = "$" + path.replace('/', '.')
final String[] pointerAndQuery = path
.replaceAll("(\\w)\\?", "$1#")
Copy link

Choose a reason for hiding this comment

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

Maybe consider something less probable as a token?

or maybe even #THIS_IS_SPLIT_PLACEHOLDER#

@piotrdytkowski piotrdytkowski merged commit 02fd39d into master Feb 4, 2022
@piotrdytkowski piotrdytkowski deleted the US-642-implement-simple-queries branch February 7, 2022 11:50
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.

3 participants