feat(api): improve codegen outputs (#41)
* Use `[]byte` for generated request bodies when the source schema has `format: byte` * Gzip-compress request bodies when `Content-Encoding: gzip` is set * Require that all models returned as error conditions in our API implement the `error` interface * Move the implementation for `api.HealthCheck` out of `ping.go` and into `api/error.go` Co-authored-by: William Baker <55118525+wbaker85@users.noreply.github.com>
This commit is contained in:
@ -70,7 +70,7 @@ func Test_PingFailedStatus(t *testing.T) {
|
||||
e := "I broke"
|
||||
client := &mock.HealthApi{
|
||||
GetHealthExecuteFn: func(api.ApiGetHealthRequest) (api.HealthCheck, *http.Response, error) {
|
||||
return api.HealthCheck{Status: api.HEALTHCHECKSTATUS_FAIL, Message: &e}, nil, nil
|
||||
return api.HealthCheck{}, nil, &api.HealthCheck{Status: api.HEALTHCHECKSTATUS_FAIL, Message: &e}
|
||||
},
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ func Test_PingFailedStatusNoMessage(t *testing.T) {
|
||||
name := "foo"
|
||||
client := &mock.HealthApi{
|
||||
GetHealthExecuteFn: func(api.ApiGetHealthRequest) (api.HealthCheck, *http.Response, error) {
|
||||
return api.HealthCheck{Status: api.HEALTHCHECKSTATUS_FAIL, Name: name}, nil, nil
|
||||
return api.HealthCheck{}, nil, &api.HealthCheck{Status: api.HEALTHCHECKSTATUS_FAIL, Name: name}
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user