v1.12.0 introduced a File type which intercepts schemas of type:string, format:binary, but it incorrectly implemented the json.Marshaler interface and was lacking tests to catch the problem. This version fixes the marshaling of fields of that type.
Prior versions of oapi-codegen turned those into a []byte, and you can still annotate your spec with x-go-type if you need []byte
Fix an issue with command line parsing
The -o flag specifying the output filename was being ignore in very simple invocations of oapi-codegen without a configuration file. This is fallout from trying to be compatible with old and new style configs.
Many bug fixes
Major changes to functionality
In the last release, we changed the configuration file format to a new syntax, and added flags to read the old version, but it turns out that this default-on change broke a lot of automation, sorry about that. In this release, we've done our best to auto-detect the configuration version, so both styles of config options should work. The explicit version selection flags have not been removed.
"strict" server generation, meaning one which is much more pedantic about input and output types, which allows for making API clients and servers that look more like Go functions than HTTP handlers (deepmap/oapi-codegen#499)
Fields can be marked with x-json-ignore to omit in JSON serialization (deepmap/oapi-codegen#390)
Many fixes to unions for oneOf and anyOf handling, thank you committers.
Enums can be prefixed with their typename in all cases, versus only on collisions previously. This is a configurable option (deepmap/oapi-codegen#662)
The Client interface in generated code was named awfully generically. You can now override the name (deepmap/oapi-codegen#788)
Generate code can be optionally formatted using more initialisms. It's default-off to not break existing code (deepmap/oapi-codegen#749)
Gin code can be configured with a custom error handler, versus generating error responses inline. Default behavior is the same as before (deepmap/oapi-codegen#587)
Gin middleware evaluation order can be reversed to be consistent with common Gin usage, it's default-off to not break previous behavior. ( deepmap/oapi-codegen#787)
Everything that has changed
This is a very large release with many bug fixes. Thanks to all contributors.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps github.com/deepmap/oapi-codegen from 1.9.0 to 1.12.2.
Release notes
Sourced from github.com/deepmap/oapi-codegen's releases.
... (truncated)
Commits
7dead8e
Fix binary string encoding65843bf
Update enum shadowing workarounda2adb9c
Fix schema shadowing issue by enums (#833)5a1784a
Configure default generator with no config8175447
Handle simple configs with output flag properlycf23455
Fix bug in oneOf not propagating external references (#729)e5ee43d
Change imports into aliases so they implement the base interface7b01009
Add client-type-prefix output option (#785) (#788)0d74b1d
Regenerate boilerplate895be61
Ft/handle external pkg name in response (#752)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)