Skip to content

Commit

Permalink
Generate description for entry names
Browse files Browse the repository at this point in the history
Entry names are special cased in the code, so they need some extra care
in the codegen code.
  • Loading branch information
kklimonda-cl committed Aug 30, 2024
1 parent 0ff9005 commit e1a0d70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/schema/object/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type GoSdkConfig struct {

type Entry struct {
Name string `yaml:"name"`
Description string `yaml:"descripion"`
Description string `yaml:"description"`
Validators []*validator.Validator `yaml:"validators"`
}

Expand Down
14 changes: 10 additions & 4 deletions pkg/translate/terraform_provider/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1269,11 +1269,17 @@ func createSchemaSpecForNormalization(resourceTyp properties.ResourceType, schem
LowerCamelCase: naming.CamelCase("", "name", "", false),
}

var description string
if spec.Entry != nil && spec.Entry.Name != nil {
description = spec.Entry.Name.Description
}

attributes = append(attributes, attributeCtx{
Package: packageName,
Name: name,
SchemaType: "StringAttribute",
Required: true,
Description: description,
Package: packageName,
Name: name,
SchemaType: "StringAttribute",
Required: true,
})
}

Expand Down

0 comments on commit e1a0d70

Please sign in to comment.