Make isSet a parameter

This commit is contained in:
Phani Teja Marupaka
2020-10-22 10:13:13 -07:00
parent 3c86d37148
commit bcaac6f8c1
4 changed files with 20 additions and 5 deletions

View File

@@ -353,6 +353,8 @@ type SetOpenAPI struct {
Description string `yaml:"description"`
SetBy string `yaml:"setBy"`
IsSet bool `yaml:"isSet"`
}
// UpdateFile updates the OpenAPI definitions in a file with the given setter value.
@@ -458,8 +460,10 @@ func (s SetOpenAPI) Filter(object *yaml.RNode) (*yaml.RNode, error) {
return nil, err
}
if err := def.PipeE(&yaml.FieldSetter{Name: "isSet", StringValue: "true"}); err != nil {
return nil, err
if s.IsSet {
if err := def.PipeE(&yaml.FieldSetter{Name: "isSet", StringValue: "true"}); err != nil {
return nil, err
}
}
if s.Description != "" {