LocalAI/openai-openapi/chi-interface.tmpl
Dave Lee 45285bb5d8
fix
2023-06-01 20:46:08 -04:00

19 lines
No EOL
857 B
Cheetah

// NOT ACTUALLY USING THIS CURRENTLY???
// ServerInterface represents all server handlers.
type ServerInterface interface {
{{range .}}{{.SummaryAsComment }}
// ({{.Method}} {{.Path}})
{{.OperationId}}(w http.ResponseWriter, r *http.Request{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}})
{{end}}
}
// TypedServerInterface is used to give each endpoint a fully typed method signature for cases where we're able to route automatically
type TypedServerInterface interface {
{{range .}}{{.SummaryAsComment }}
// ({{.Method}} {{.Path}})
{{$reqBody := genDefaultRequestBodyType . -}}
{{- if ne $reqBody "" }}{{$reqBody = printf ", body %s" $reqBody}}{{end -}}
{{.OperationId}}(w http.ResponseWriter{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}{{$reqBody}})
{{end}}
}