oapi-codegen
oapi-codegen copied to clipboard
Strict server generates error for text/plain response types
When generating strict server using version 2.5.0 and respons type of text/plain the generated code looks something like this (for echo):
type InternalServerErrorTextResponse string
type DeleteRequest500TextResponse struct {
InternalServerErrorTextResponse
}
func (response DeleteRequest500TextResponse) VisitDeleteRequestResponse(w http.ResponseWriter) error {
w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(500)
_, err := w.Write([]byte(response))
return err
}
This does not compile with an error cannot convert response (variable of struct type DeleteRequest500TextResponse) to type []byte