Suggested Changes

This commit is contained in:
Phani Teja Marupaka
2020-05-06 12:38:12 -07:00
parent e771902a07
commit 7309a5cb06
2 changed files with 8 additions and 8 deletions

View File

@@ -76,8 +76,9 @@ func (r *CreateSubstitutionRunner) preRunE(c *cobra.Command, args []string) erro
return err
}
_, err = openapi.Resolve(&ref) // resolve the setter to its openAPI def
if err == nil {
setter, _ := openapi.Resolve(&ref)
// if setter already exists with input substitution name, throw error
if setter != nil {
return errors.Errorf(fmt.Sprintf("setter with name %s already exists, "+
"substitution and setter can't have same name", r.CreateSubstitution.Name))
}