added count for creating setters

This commit is contained in:
Thomas Rodgers
2020-06-26 15:46:57 -07:00
parent 4cae8cfe9b
commit d4ed285fd1
2 changed files with 23 additions and 19 deletions

View File

@@ -37,6 +37,9 @@ type Add struct {
// Type is the type of the setter value
Type string
// Count is the number of fields the setter applies to
Count int
}
// Filter implements yaml.Filter
@@ -104,6 +107,7 @@ func (a *Add) visitScalar(object *yaml.RNode, p string, _ *openapi.ResourceSchem
if a.FieldValue != "" && a.FieldValue != object.YNode().Value {
return nil
}
a.Count++
return a.addRef(object)
}