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

Remove validation that made keys starting or ending with . - or _ invalid, catch all exceptions in the parse json processor #2936

Closed
wants to merge 1 commit into from

Conversation

graytaylor0
Copy link
Member

@graytaylor0 graytaylor0 commented Jun 26, 2023

Description

  • Allows keys starting or ending with ., -, or _ in JacksonEvent
  • Catch all exceptions in the parse_json processor

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…alid, catch all exceptions in the parse json processor

Signed-off-by: Taylor Gray <tylgry@amazon.com>
kkondaka
kkondaka previously approved these changes Jun 26, 2023
writeToRoot(event, parsedJson);
} else {
event.put(destination, parsedJson);
final Event event = record.getData();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: seems like this block is double indented which is showing more of a diff than there actually is

}

if ((i == 0 || i == key.length() - 1 || previous == '/' || next == '/') && (c == '_' || c == '.' || c == '-')) {
return false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What was the motivation for not allowing these characters initially? I'm wondering what the consequences of this change would be

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure what the reasoning was

Copy link
Member Author

@graytaylor0 graytaylor0 Jun 27, 2023

Choose a reason for hiding this comment

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

This is the PR where I added this custom code (https://github.com/opensearch-project/data-prepper/pull/725/files). But the regex pattern that was used to validate before (which disallowed starting or ending with these characters) was added by @cmanning09

@graytaylor0
Copy link
Member Author

Moved to #2945

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