Skip to content

Commit 18301d0

Browse files
authored
Accept header forces application/json type even if server (#10337)
* fix!: accept should not force application JSON Generated code offen provides range of accept methods. This method improperly takes JSON as preferred Example: localVarHTTPHeaderAccepts := []string{"application/zip", "application/json"} * chore: generated changes
1 parent 61852a0 commit 18301d0

4 files changed

Lines changed: 0 additions & 16 deletions

File tree

modules/openapi-generator/src/main/resources/go/client.mustache

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ func selectHeaderAccept(accepts []string) string {
101101
return ""
102102
}
103103

104-
if contains(accepts, "application/json") {
105-
return "application/json"
106-
}
107-
108104
return strings.Join(accepts, ",")
109105
}
110106

samples/client/petstore/go/go-petstore/client.go

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/client.go

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/openapi3/client/petstore/go/go-petstore/client.go

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)