MCPcopy Create free account
hub / github.com/cloudwan/gohan / convertCustomActionOutput

Function convertCustomActionOutput

cli/template.go:211–222  ·  view source on GitHub ↗
(schemas []*SchemaWithPolicy)

Source from the content-addressed store, hash-verified

209}
210
211func 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
224func 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})

Callers 1

doTemplateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected