8000 [Change Proposal] Relax validations on required fields · Issue #843 · elastic/package-spec · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[Change Proposal] Relax validations on required fields #843
Open
@jsoriano

Description

@jsoriano

We currently check at the spec level that some fields are required, here:

// 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussIssue needs discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0