Skip to content

Commit

Permalink
Plain string body type can not be set
Browse files Browse the repository at this point in the history
  • Loading branch information
Vad1mo authored Mar 2, 2018
1 parent 8e0a0eb commit 655dbbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/swagger-codegen/src/main/resources/go/client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e
_, err = bodyBuf.ReadFrom(reader)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {
_, err = bodyBuf.WriteString(s)
} else if s, ok := body.(*string); ok {
_, err = bodyBuf.WriteString(*s)
} else if jsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if xmlCheck.MatchString(contentType) {
Expand Down

0 comments on commit 655dbbf

Please sign in to comment.