v1.12.0
版本发布时间: 2022-10-28 08:25:33
oapi-codegen/oapi-codegen最新发布版本:v2.3.0(2024-06-07 05:00:34)
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.
- Gorilla router (https://github.com/deepmap/oapi-codegen/pull/594)
- "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 (https://github.com/deepmap/oapi-codegen/pull/499)
- Fields can be marked with
x-json-ignore
to omit in JSON serialization (https://github.com/deepmap/oapi-codegen/pull/390) - Many fixes to unions for
oneOf
andanyOf
handling, thank you committers. - Enums can be prefixed with their typename in all cases, versus only on collisions previously. This is a configurable option (https://github.com/deepmap/oapi-codegen/pull/662)
- The
Client
interface in generated code was named awfully generically. You can now override the name (https://github.com/deepmap/oapi-codegen/pull/788) - Generate code can be optionally formatted using more initialisms. It's default-off to not break existing code (https://github.com/deepmap/oapi-codegen/pull/749)
- Gin code can be configured with a custom error handler, versus generating error responses inline. Default behavior is the same as before (https://github.com/deepmap/oapi-codegen/pull/587)
- Gin middleware evaluation order can be reversed to be consistent with common Gin usage, it's default-off to not break previous behavior. ( https://github.com/deepmap/oapi-codegen/pull/787)
Everything that has changed
This is a very large release with many bug fixes. Thanks to all contributors.
- use BindStyledParameterWithLocation with path params by @jcalvarado1965 in https://github.com/deepmap/oapi-codegen/pull/564
- Correct reference to flag for backwards compatible configuration by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/594
- Add support for Gorilla generation by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/585
- chi : Change the signature of the
MiddlewareFunc
for compatibilities. by @uhey22e in https://github.com/deepmap/oapi-codegen/pull/578 - docs: replace go get with go install by @mycrEEpy in https://github.com/deepmap/oapi-codegen/pull/588
- oneOf/anyOf support (including discriminator) by @Warboss-rus in https://github.com/deepmap/oapi-codegen/pull/471
- refactor(pkg/codegen): add goCode to error by @sashamelentyev in https://github.com/deepmap/oapi-codegen/pull/599
- Add missing space between words by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/589
- [#211] Generate OpenAPI dictionaries without fixed keys as maps by @natsukagami in https://github.com/deepmap/oapi-codegen/pull/424
- Fix UUID query param binding by @karl-dau in https://github.com/deepmap/oapi-codegen/pull/623
- Strict server generation by @Warboss-rus in https://github.com/deepmap/oapi-codegen/pull/499
- comment fixed in gin example code by @nsaltun in https://github.com/deepmap/oapi-codegen/pull/646
- Fix small typo in comment by @LelouBil in https://github.com/deepmap/oapi-codegen/pull/641
- Support param styling for UUIDs by @rliebz in https://github.com/deepmap/oapi-codegen/pull/643
- Allow binding types as parameters through
String()
methods by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/638 - fix: support encoding.TextMarshaler in StyleParamWithLocation by @mazitovt in https://github.com/deepmap/oapi-codegen/pull/634
- implement new field: x-go-type-import by @VladimirStepanov in https://github.com/deepmap/oapi-codegen/pull/633
- Fix x-go-type-import code generation by @WesleyMiller1998 in https://github.com/deepmap/oapi-codegen/pull/682
- Correct YAML config example by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/665
- fix: percent in enum values by @corani in https://github.com/deepmap/oapi-codegen/pull/664
- Order request body definitions by content type by @mikesep in https://github.com/deepmap/oapi-codegen/pull/686
- Add option to prefix enum values with their typename by @corani in https://github.com/deepmap/oapi-codegen/pull/662
- Update README config example to use the new schema by @tfaller in https://github.com/deepmap/oapi-codegen/pull/613
- Remove generation of code to handle optional query parameters by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/671
- Fix: Handle unset
union
map type by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/650 - Allow providing custom error funcs in strict chi server by @chadweimer in https://github.com/deepmap/oapi-codegen/pull/649
- Add test for empty enum value by @tfaller in https://github.com/deepmap/oapi-codegen/pull/612
- Update README to match the new syntax by @lzap in https://github.com/deepmap/oapi-codegen/pull/630
- Fix: gorilla required header error shadowing by @wmarinic in https://github.com/deepmap/oapi-codegen/pull/689
- Allow merging multiple union types by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/670
- Fix readonly+required property by @florentchauveau in https://github.com/deepmap/oapi-codegen/pull/605
- Fix Date (header) param binding by @hslatman in https://github.com/deepmap/oapi-codegen/pull/628
- Generate type names in GoDoc comments by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/601
- Add basic automated builds by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/602
- Allow custom JSON media types to be marked as
IsJson
by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/582 - handle oapi3.MultiError messages by @joerocklin in https://github.com/deepmap/oapi-codegen/pull/572
- Finish
spec
documentation by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/706 - Document the README may not be latest tag by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/705
- Correct error message for new flag by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/699
- Add support for strict server with Gorilla by @DouglasDwyer in https://github.com/deepmap/oapi-codegen/pull/716
- Remove io/ioutil by @leonnicolas in https://github.com/deepmap/oapi-codegen/pull/727
- BindStringToObject() allows silent overflow of narrower-than-64-bit numeric types by @danielbprice in https://github.com/deepmap/oapi-codegen/pull/740
- Fix/handle initial digit of http header by @masu-mi in https://github.com/deepmap/oapi-codegen/pull/733
- Strongly typed responses for strict server by @Warboss-rus in https://github.com/deepmap/oapi-codegen/pull/701
- Be more flexible parsing config files. by @deepmap-marcinr in https://github.com/deepmap/oapi-codegen/pull/747
- Ft/remove loop by @masu-mi in https://github.com/deepmap/oapi-codegen/pull/750
- Bump github.com/labstack/echo/v4 from 4.7.2 to 4.9.0 by @dependabot in https://github.com/deepmap/oapi-codegen/pull/767
- Correctly
go:generate
test client code by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/772 - Fix a bug where strict json decoder is not used. by @Fethbita in https://github.com/deepmap/oapi-codegen/pull/757
- Migrate deprecated io/ioutil package to io and os packages by @mycrEEpy in https://github.com/deepmap/oapi-codegen/pull/755
- Fix docs by @alexpts in https://github.com/deepmap/oapi-codegen/pull/754
- Migrate to
tidied
by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/725 - Added implementation of x-json-ignore by @sparshev in https://github.com/deepmap/oapi-codegen/pull/390
- Update go to 1.18 by @mycrEEpy in https://github.com/deepmap/oapi-codegen/pull/756
- Default integer data types to
int
when using custom formats by @bearcherian in https://github.com/deepmap/oapi-codegen/pull/741 - chore: Update dependencies by @mycrEEpy in https://github.com/deepmap/oapi-codegen/pull/780
- cleanup: Remove dependency github.com/cyberdelia/templates by @mycrEEpy in https://github.com/deepmap/oapi-codegen/pull/781
- fixed typo by @kosuke-taniguchi in https://github.com/deepmap/oapi-codegen/pull/779
- fix typo by @nandedamana in https://github.com/deepmap/oapi-codegen/pull/792
- Fix #737: CLI documentation by @nandedamana in https://github.com/deepmap/oapi-codegen/pull/797
- Rewrite imports parsing (issue #760) by @VladimirStepanov in https://github.com/deepmap/oapi-codegen/pull/804
- Add Problem Details content types by @veleek in https://github.com/deepmap/oapi-codegen/pull/802
- fix 794 (no error message for invalid CLI options placed after the in… by @nandedamana in https://github.com/deepmap/oapi-codegen/pull/796
- Generate names with initialisms by @wtertius in https://github.com/deepmap/oapi-codegen/pull/749
- Fixed #719: fix generate for union methods. by @insidieux in https://github.com/deepmap/oapi-codegen/pull/720
- Chain Chi middlewares in reverse order so they execute first-to-last by @ericvolp12 in https://github.com/deepmap/oapi-codegen/pull/787
- chore: Fix comments/imports by @Jleagle in https://github.com/deepmap/oapi-codegen/pull/789
- Add extra JSON type checking by @AnnaDodson in https://github.com/deepmap/oapi-codegen/pull/808
- Ensure embedded spec contains all necessary OpenAPI documents by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/771
- Onboard to Dependabot by @jamietanna in https://github.com/deepmap/oapi-codegen/pull/815
- Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 by @dependabot in https://github.com/deepmap/oapi-codegen/pull/816
- Bump github.com/labstack/echo/v4 from 4.9.0 to 4.9.1 by @dependabot in https://github.com/deepmap/oapi-codegen/pull/818
- Bump golang.org/x/tools from 0.1.12 to 0.2.0 by @dependabot in https://github.com/deepmap/oapi-codegen/pull/817
- Bump github.com/getkin/kin-openapi from 0.104.0 to 0.106.0 by @dependabot in https://github.com/deepmap/oapi-codegen/pull/819
- Fix/handle initial digit of operation by @masu-mi in https://github.com/deepmap/oapi-codegen/pull/735
- gin server custom error handler option by @chaseisabelle in https://github.com/deepmap/oapi-codegen/pull/587
- Fixed an issue where null values were incorrectly generated when AnyOf was set by @ShouheiNishi in https://github.com/deepmap/oapi-codegen/pull/812
- Typos by @Jleagle in https://github.com/deepmap/oapi-codegen/pull/814
- Fix styling AnyOf issue by @ShouheiNishi in https://github.com/deepmap/oapi-codegen/pull/809
- Ft/handle external pkg name in response by @masu-mi in https://github.com/deepmap/oapi-codegen/pull/752
- Add client-type-prefix output option (#785) by @jedrivisser in https://github.com/deepmap/oapi-codegen/pull/788
- Fix bug in oneOf not propagating external references by @technicianted in https://github.com/deepmap/oapi-codegen/pull/729
New Contributors
- @jcalvarado1965 made their first contribution in https://github.com/deepmap/oapi-codegen/pull/564
- @uhey22e made their first contribution in https://github.com/deepmap/oapi-codegen/pull/578
- @mycrEEpy made their first contribution in https://github.com/deepmap/oapi-codegen/pull/588
- @Warboss-rus made their first contribution in https://github.com/deepmap/oapi-codegen/pull/471
- @sashamelentyev made their first contribution in https://github.com/deepmap/oapi-codegen/pull/599
- @karl-dau made their first contribution in https://github.com/deepmap/oapi-codegen/pull/623
- @nsaltun made their first contribution in https://github.com/deepmap/oapi-codegen/pull/646
- @LelouBil made their first contribution in https://github.com/deepmap/oapi-codegen/pull/641
- @mazitovt made their first contribution in https://github.com/deepmap/oapi-codegen/pull/634
- @VladimirStepanov made their first contribution in https://github.com/deepmap/oapi-codegen/pull/633
- @WesleyMiller1998 made their first contribution in https://github.com/deepmap/oapi-codegen/pull/682
- @corani made their first contribution in https://github.com/deepmap/oapi-codegen/pull/664
- @mikesep made their first contribution in https://github.com/deepmap/oapi-codegen/pull/686
- @chadweimer made their first contribution in https://github.com/deepmap/oapi-codegen/pull/649
- @lzap made their first contribution in https://github.com/deepmap/oapi-codegen/pull/630
- @wmarinic made their first contribution in https://github.com/deepmap/oapi-codegen/pull/689
- @florentchauveau made their first contribution in https://github.com/deepmap/oapi-codegen/pull/605
- @hslatman made their first contribution in https://github.com/deepmap/oapi-codegen/pull/628
- @joerocklin made their first contribution in https://github.com/deepmap/oapi-codegen/pull/572
- @DouglasDwyer made their first contribution in https://github.com/deepmap/oapi-codegen/pull/716
- @leonnicolas made their first contribution in https://github.com/deepmap/oapi-codegen/pull/727
- @danielbprice made their first contribution in https://github.com/deepmap/oapi-codegen/pull/740
- @masu-mi made their first contribution in https://github.com/deepmap/oapi-codegen/pull/733
- @deepmap-marcinr made their first contribution in https://github.com/deepmap/oapi-codegen/pull/747
- @dependabot made their first contribution in https://github.com/deepmap/oapi-codegen/pull/767
- @Fethbita made their first contribution in https://github.com/deepmap/oapi-codegen/pull/757
- @alexpts made their first contribution in https://github.com/deepmap/oapi-codegen/pull/754
- @sparshev made their first contribution in https://github.com/deepmap/oapi-codegen/pull/390
- @bearcherian made their first contribution in https://github.com/deepmap/oapi-codegen/pull/741
- @kosuke-taniguchi made their first contribution in https://github.com/deepmap/oapi-codegen/pull/779
- @nandedamana made their first contribution in https://github.com/deepmap/oapi-codegen/pull/792
- @veleek made their first contribution in https://github.com/deepmap/oapi-codegen/pull/802
- @insidieux made their first contribution in https://github.com/deepmap/oapi-codegen/pull/720
- @AnnaDodson made their first contribution in https://github.com/deepmap/oapi-codegen/pull/808
- @chaseisabelle made their first contribution in https://github.com/deepmap/oapi-codegen/pull/587
- @ShouheiNishi made their first contribution in https://github.com/deepmap/oapi-codegen/pull/812
- @jedrivisser made their first contribution in https://github.com/deepmap/oapi-codegen/pull/788
- @technicianted made their first contribution in https://github.com/deepmap/oapi-codegen/pull/729
Full Changelog: https://github.com/deepmap/oapi-codegen/compare/v1.11.0...v1.12.0