-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
When the response is of type text/plain generated server code is trying to convert to []byte while the response object is a struct
ForbiddenError:
description: Access token is valid but does not have the required scope
content:
text/plain:
schema:
type: string
example: Forbiddengenerated code
type GetAccounts403TextResponse struct{ ForbiddenErrorTextResponse }
func (response GetAccounts403TextResponse) VisitGetAccountsResponse(w http.ResponseWriter) error {
w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(403)
_, err := w.Write([]byte(response))
return err
}_, err := w.Write([]byte(response)) fails at compile time