* 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>
Custom OpenAPI Templates
This directory contains custom mustache templates used by the OpenAPI code generator. The original templates were extracted by running:
openapi-generator author template -g go
NOTE: This command extracts a copy of every template used by the generator, but we only track templates that we've modified here. The generator can handle sourcing templates from multiple locations.
What have we changed?
api.mustache
- Add
GetX()methods for each request parameterX, for use in unit tests - Add checks for
isByteArrayto generate[]byterequest fields instead of*string - Update creation of
GenericOpenAPIErrorto track sub-error models by reference
client.mustache
- Removed use of
golang.org/x/oauth2to avoid its heavy dependencies - Fixed error strings to be idiomatic according to staticcheck (lowercase, no punctuation)
- Use
strings.EqualFoldinstead of comparing twostrings.ToLowercalls - GZip request bodies when
Content-Encoding: gzipis set - Update the
GenericOpenAPIErrortype to enforce that error response models implement theerrorinterface
configuration.mustache
- Deleted
ContextOAuth2key to match modification in client - Fixed error strings to be idiomatic according to staticcheck (lowercase, no punctuation)