wire set 2.0 command

This commit is contained in:
Phillip Wittrock
2020-02-13 17:19:50 -08:00
parent 1ce469f1fd
commit 61cf3e6ec5
4 changed files with 362 additions and 7 deletions

View File

@@ -16,12 +16,17 @@ type FieldSetter struct {
// Value is the value to set
Value string
Description string
SetBy string
}
// Set updates the OpenAPI definitions and resources with the new setter value
func (fs FieldSetter) Set(openAPIPath, resourcesPath string) (int, error) {
// Update the OpenAPI definitions
soa := setters2.SetOpenAPI{Name: fs.Name, Value: fs.Value}
soa := setters2.SetOpenAPI{
Name: fs.Name, Value: fs.Value, Description: fs.Description, SetBy: fs.SetBy}
if err := soa.UpdateFile(openAPIPath); err != nil {
return 0, err
}