-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Labels
discussIssue needs discussionIssue needs discussion
Description
We currently check at the spec level that some fields are required, here:
package-spec/code/go/internal/validator/semantic/validate_required_fields.go
Lines 14 to 25 in 5325b7e
// ValidateRequiredFields validates that required fields are present and have the expected | |
// types. | |
func ValidateRequiredFields(fsys fspath.FS) specerrors.ValidationErrors { | |
requiredFields := map[string]string{ | |
"data_stream.type": "constant_keyword", | |
"data_stream.dataset": "constant_keyword", | |
"data_stream.namespace": "constant_keyword", | |
"@timestamp": "date", | |
} | |
return validateRequiredFields(fsys, requiredFields) | |
} |
The definition of these fields is already provided in many cases by ecs@mappings
, and its definition doesn't grant that they are correctly used, this can be only checked with system tests. Current implementation forces packages developers to include this boilerplate fields.
So maybe we should remove the expectation on these fields from the spec, and ensure that elastic-package
can detect misuses or absence of these fields.
tommyers-elastic
Metadata
Metadata
Assignees
Labels
discussIssue needs discussionIssue needs discussion