Auto-generate fields of enum

dev
Ice3man543 2021-08-24 14:37:34 +05:30
parent e48c8bef23
commit 3476e5b7c1
1 changed files with 3 additions and 1 deletions

View File

@ -63,7 +63,9 @@ func (severityHolder SeverityHolder) JSONSchemaType() *jsonschema.Type {
Type: "string",
Title: "severity of the template",
Description: "Seriousness of the implications of the template",
Enum: []interface{}{Info.String(), Low.String(), Medium.String(), High.String(), Critical.String()},
}
for _, severity := range GetSupportedSeverities() {
gotType.Enum = append(gotType.Enum, severity.String())
}
return gotType
}