Defer openAPI cleanup

This commit is contained in:
Phani Teja Marupaka
2020-11-02 12:07:32 -08:00
parent 49094cf999
commit ec2cc2d421
13 changed files with 110 additions and 92 deletions

View File

@@ -154,7 +154,8 @@ openAPI:
if !assert.NoError(t, err) {
t.FailNow()
}
err = openapi.AddSchemaFromFile(filepath.Join(dir, "Krmfile"))
clean, err := openapi.AddSchemaFromFile(filepath.Join(dir, "Krmfile"))
defer clean()
if err != nil {
// do nothing if openAPI file or schema doesn't exist, CheckRequiredSettersSet()
// should not throw any error