-
Notifications
You must be signed in to change notification settings - Fork 72
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
Disallow unknown properties on fields definitions #281
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 like this idea in general, but I remember we kept it open because we couldn't satisfy all features (multi-fields, example, etc.). Did you check how does this change behaves with existing packages?
I have checked with some packages now, and I have found that most of the missing properties can be added to the spec. To add a type, we would need further customization options in the Changing the examples to their string representation would be an effort in some packages, but wouldn't be a bad idea, these examples are thought for documentation purposes, and it may be good to have control on their format. We actually use strings for everything, except for numbers, so probably the migration effort could be automated. In any case we could add a semantic validator to check that the examples comply with the field type. |
I have created #282 to follow on this. |
If we change all of them to the string representation, we also need to change the ones imported from ECS, there the examples can contain at least numbers. |
I'm wondering if there aren't any problems with multi fields (see elastic/elastic-package#678). |
We can validate them (see ee17cfa), this other issue seems to be about importing external fields with multi fields. |
Closing this, after #314 we are in a better situation. |
What does this PR do?
Disallow unknown properties on fields definitions.
Why is it important?
Avoid typos as the ones reported in elastic/integrations#2643.
Checklist
test/packages
that prove my change is effective.versions/N/changelog.yml
.Related issues