-
Notifications
You must be signed in to change notification settings - Fork 119
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
Fix validation of properties and parameters based on mappings #2288
Conversation
test integrations |
Created or updated PR in integrations repository to test this version. Check elastic/integrations#12155 |
@@ -647,7 +723,7 @@ func TestComparingMappings(t *testing.T) { | |||
) | |||
require.NoError(t, err) | |||
|
|||
errs := v.compareMappings("", c.preview, c.actual) | |||
errs := v.compareMappings("", false, c.preview, c.actual) |
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.
Added a new parameter here to know in which cases properties
could be part of the parameters of a mapping or a subfield named properties
.
💚 Build Succeeded
History
cc @mrodm |
test integrations |
errs = append(errs, propertiesErrs...) | ||
if len(errs) == 0 { | ||
return nil | ||
} | ||
return errs.Unique() | ||
} | ||
|
||
func (v *MappingValidator) validateObjectProperties(path string, containsMultifield bool, actual, preview map[string]any) multierror.Error { | ||
func (v *MappingValidator) validateObjectProperties(path string, couldBeParametersDefinition, containsMultifield bool, preview, actual map[string]any) multierror.Error { |
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.
Reordered preview and actual parameters to keep consistency with the other methods.
Created or updated PR in integrations repository to test this version. Check elastic/integrations#12155 |
Follows #2214
In this PR, it is ensured that:
properties
are validated and not considered as another parameter of the object. For instance, a mapping like: