-
Notifications
You must be signed in to change notification settings - Fork 116
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
Validate that event.type is aligned with event.category #961
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I admit that it wasn't easy to go through the logic :) Maybe it's the first symptom to refactor the fields
code.
Yeah, this is the first time we need to validate the values of two fields at the same time, this is why I ended up passing the whole document through all the calls chain so when validating one field we can check the value of the other. Two possible alternatives would be:
|
🌐 Coverage report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frankly speaking, both propositions are rather hackish. I think that I'd rather keep your current proposal (PR).
Yep, I also prefer the current approach even if not so nice to have to pass the document around. |
Integration tests found an issue, After this change I will start with #963. |
Fields like
event.category
in ECS define a list of allowed values forevent.type
, check that these values are aligned.This check is only enabled for packages using at least format version 2.0.0.
Fixes #837.
Part of elastic/package-spec#399.