big progress checkin. Still quite broken, but now it shows the new direction. Time to start hooking things up again.

This commit is contained in:
Dave Lee 2023-06-01 20:44:54 -04:00
parent 20a0cd2f66
commit f9133b5a61
No known key found for this signature in database
12 changed files with 228 additions and 364 deletions

View file

@ -0,0 +1,17 @@
// 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}}
}