Skip to content

[8.1] DotExpandingXContentParser to expose the original token location (#84970)#85032

Merged
javanna merged 1 commit intoelastic:8.1from
javanna:backport/8.1/pr-84970
Mar 16, 2022
Merged

[8.1] DotExpandingXContentParser to expose the original token location (#84970)#85032
javanna merged 1 commit intoelastic:8.1from
javanna:backport/8.1/pr-84970

Conversation

@javanna
Copy link
Copy Markdown
Contributor

@javanna javanna commented Mar 16, 2022

Backports the following commits to 8.1:

…stic#84970)

With elastic#79922 we have introduced a parser that expands dots in fields names on the fly, so that the expansion no longer needs to be handled by consumers.

The token location exposed by such parser can be confusing to interpret: consumers are parsing the expanded version which requires jumping ahead reading tokens and exposing additional field names and start objects, while users have sent the unexpanded version and would like errors to refer to the original content.

This commit adds a test for this scenario and tweaks the DotExpandingXContentParser to cache the token location before jumping ahead to expand dots in field names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants