Skip to content

BREAKING CHANGE: replace resursive search with JSON pointer#9

Closed
essioc wants to merge 1 commit intoepics-modules:mainfrom
essioc:feat-json-pointer-support
Closed

BREAKING CHANGE: replace resursive search with JSON pointer#9
essioc wants to merge 1 commit intoepics-modules:mainfrom
essioc:feat-json-pointer-support

Conversation

@essioc
Copy link
Copy Markdown
Contributor

@essioc essioc commented Mar 19, 2026

Previously, the module recursively looped and checked key in the iterable. It had a limitation that it could not handle mixed types, root array, and empty key.

JSON Pointer solves this problem because it can address all points in a JSON object whether it is an array or a dictionary.

See also: https://datatracker.ietf.org/doc/html/rfc6901

Breaking change

Previous way of referring to JSON field will no longer work. If backward compatibility is desired, calling previous search method first and then applying JSON pointer (at cost of unspecified search speed)

Exception handling

There are new possible exceptions coming from to_string, json::at, and json::json_pointer. These errors were already being caught at the catch-all handler at following line, so new handling code was not necessary.

Other considerations

onMessageCb function may benefit from some refactoring, where the values are not always converted into string but into corresponding numeric types, by merging the two steps of identifying if it's JSON and whether the item exists or not, and then matching requested types and converting it into numeric as needed. This optimization was not carried out in this merge request.

Previously, the module recursively looped and checked
key in the iterable. It had a limitation that it could not handle
mixed types, root array, and empty key.

JSON Pointer solves this problem because it can address all points in a
JSON object whether it is an array or a dictionary.

See also: https://datatracker.ietf.org/doc/html/rfc6901

BREAKING CHANGE: Previous json field addressing will no longer work
@essioc essioc changed the title BREAKING CHANGE: replace resursive search with JSON pointer Draft: BREAKING CHANGE: replace resursive search with JSON pointer Mar 19, 2026
@essioc essioc marked this pull request as draft March 19, 2026 12:52
@essioc essioc changed the title Draft: BREAKING CHANGE: replace resursive search with JSON pointer BREAKING CHANGE: replace resursive search with JSON pointer Mar 19, 2026
@essioc essioc marked this pull request as ready for review March 19, 2026 12:57
@essioc essioc marked this pull request as draft March 19, 2026 13:20
@essioc essioc marked this pull request as ready for review March 20, 2026 08:29
@essioc essioc marked this pull request as draft March 20, 2026 15:34
@essioc
Copy link
Copy Markdown
Contributor Author

essioc commented Mar 20, 2026

Reconsidering this merge request; there is some rework needed to add write support, which may change how the data address is configured.

@essioc essioc closed this Mar 20, 2026
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