Skip to content

fix: entries() use names as keys - name to key escape rules #62

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

Merged
merged 3 commits into from
Jul 8, 2024

Conversation

jbee
Copy link
Collaborator

@jbee jbee commented Jul 8, 2024

Two main fixes

  • JsonObject#entries() method needs to use names (not keys) as their Map.Entry keys (for consistency with JsonNode#entries() and the general logic that if you get both path and value together the paths are plain/raw)
  • JsonPath#keysOf needed more logic to correctly decide when and how to escape the given plain/raw name to correctly handle names which contain valid curly segments (like OpenAPI paths do when they contain a path variable like {uid})

Also this adds new paths() methods to access the JsonPath segments of a node or value. This was an obvious method that got forgotten in the PR introducing the JsonPath concept.

@jbee jbee self-assigned this Jul 8, 2024
@jbee jbee merged commit a9869b4 into dhis2:main Jul 8, 2024
1 check 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.

1 participant