Skip to content

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Sep 29, 2025

Goal

Enable the next phase of our remote SDK configuration with a simple data extractor.

Design

The new JsonCollectionPath class implements the parsing of the path into nodes, and encapsulates the data extraction.

Calling JsonCollectionPath.fromString splits the string on the dot ('.') character and then builds a chain of PathNode objects based on each unit of the path:

  • '*' becomes a WildcardNode and matches all elements in an array, and all values in an object
  • Positive integers become PositiveIndex objects and attempt to match the numbered element of an array. If asked to match against an object (Map) the index is treated as a property name
  • Negative integers become NegativeIndex objects and attempt to match an element from the end of an array (-1 is the last element, -2 is the second-from-last, and so-on). If asked to match against an object (Map) the index is treated as a property name (verbatim)
  • All other strings are treated as a property name for a JSON object (Map) and will not match anything else.

Testing

New unit tests introduced.

@lemnik lemnik requested a review from YYChen01988 as a code owner September 29, 2025 15:00
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Sep 29, 2025

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1837.34 1602.98
arm64_v8a 647.43 409.86
armeabi_v7a 590.09 352.52
x86 717.04 483.57
x86_64 692.47 454.9

Generated by 🚫 Danger

@lemnik lemnik force-pushed the PLAT-14659/path-matcher branch from bded5af to 7c9a871 Compare October 2, 2025 08:02
Copy link
Contributor

@yousif-bugsnag yousif-bugsnag 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.

3 participants