Disallow unknown properties on fields definitions#281
Disallow unknown properties on fields definitions#281jsoriano wants to merge 6 commits intoelastic:mainfrom
Conversation
mtojek
left a comment
There was a problem hiding this comment.
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/packagesthat prove my change is effective.versions/N/changelog.yml.Related issues