Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/fields/dependency_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ func transformImportedField(fd FieldDefinition, options InjectFieldsOptions) com
"type": fd.Type,
}

if fd.ObjectType != "" {
m["object_type"] = fd.ObjectType
}

// Multi-fields don't have descriptions.
if fd.Description != "" {
m["description"] = fd.Description
Expand Down
21 changes: 21 additions & 0 deletions internal/fields/dependency_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,27 @@ func TestDependencyManagerWithECS(t *testing.T) {
assert.False(t, ok)
},
},
{
title: "object type is imported",
defs: []common.MapStr{
{
"name": "container.labels",
"external": "ecs",
},
},
options: InjectFieldsOptions{
IncludeValidationSettings: true,
},
valid: true,
result: []common.MapStr{
{
"name": "container.labels",
"description": "Image labels.",
"type": "object",
"object_type": "keyword",
},
},
},
}

for _, c := range cases {
Expand Down