Skip to content

Commit

Permalink
legacymeta: fix config value list type
Browse files Browse the repository at this point in the history
  • Loading branch information
eandre committed Apr 4, 2023
1 parent 3cb1967 commit 4d60898
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion v2/app/legacymeta/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,19 @@ func (b *builder) configValue(typ schemav2.NamedType) *schema.Type {
switch typ.DeclInfo.Name {
case "Value", "Values":
isList := typ.DeclInfo.Name == "Values"
elem := b.schemaType(typ.TypeArgs[0])

if isList {
elem = &schema.Type{Typ: &schema.Type_List{
List: &schema.List{
Elem: elem,
},
}}
}

return &schema.Type{Typ: &schema.Type_Config{
Config: &schema.ConfigValue{
Elem: b.schemaType(typ.TypeArgs[0]),
Elem: elem,
IsValuesList: isList,
},
}}
Expand Down

0 comments on commit 4d60898

Please sign in to comment.