| 209 | } |
| 210 | |
| 211 | func convertCustomActionOutput(schemas []*SchemaWithPolicy) { |
| 212 | for _, schema := range schemas { |
| 213 | for _, action := range schema.Schema.Actions { |
| 214 | if val := action.OutputSchema["type"]; val != nil { |
| 215 | if stringVal, ok := val.(string); ok && stringVal != "object" { |
| 216 | delete(action.OutputSchema, "type") |
| 217 | action.OutputSchema["$ref"] = "#/definitions/" + stringVal |
| 218 | } |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | func applyTemplateForAll(schemas []*SchemaWithPolicy, tpl *pongo2.Template, title, version, description, outputPath string) { |
| 225 | output, err := tpl.Execute(pongo2.Context{"schemas": schemas, "title": title, "version": version, "description": description}) |