v2.2.0
版本发布时间: 2024-06-04 14:15:08
oapi-codegen/oapi-codegen最新发布版本:v2.3.0(2024-06-07 05:00:34)
Big announcements
In case you've missed it, we've got a few big announcements as maintainers of oapi-codegen
which we'd recommend you read in more depth.
-
oapi-codegen
is moving to its own org- This is from release v2.3.0, but will be enacted likely before you get a chance to read these release notes, as we want to migrate everything to the same org ASAP
-
Creating a more sustainable model for
oapi-codegen
in the future- Please consider looking at sponsoring the maintenance that we do on the project.
We'd also like to thank our sponsors for this release:
🔊 Notable features
The v2.2.0 release was largely focussed on the following big changes, alongside a number of other bug fixes.
Generate a pure Go 1.22+ net/http
server
With Go 1.22+'s enhanced routing, it's now easier than ever to be able to write a pure-Go HTTP service, and thanks to a contribution from @thedadams we now have a std-http-server
, further documented in the Supported Servers section in the README.
[!NOTE] Not seeing this working, i.e. seeing a
404 page not found
? Make sure that thego
directive in your project'sgo.mod
is updated!In the future we're going to see if we can preemptively warn you if you're not quite set up correctly.
Documentation overhaul
A significant undertaking in this release was to rewrite pretty much every line of documentation we had, as well as introducing a number of additional examples and test cases.
We're excited to hear your feedback on the new structure of the README, the additional docs added, and whether there are any additional examples that may be of use.
JSON Schema configuration
In the spirit of documentation, we now also have a JSON schema which can be found further documented in the Usage section in the README.
This not only gives a separate definition of fields and their meaning, but it can be used with IDEs for autocompletion and validation, allowing for a much better Developer Experience.
kin-openapi upgrade
A few big upgrades have come in kin-openapi, which we use for the underlying OpenAPI parsing and validation, which included a significant breaking change that meant that consumers of oapi-codegen
couldn't upgrade the kin-openapi version until we had made changes in oapi-codegen
.
This has additionally been set up as an FAQ as it's one we commonly get.
🚀 New features and improvements
- feat: add ability to tweak generated names (including use of initialisms) (#1041) @wtertius
- docs: revamp README, add a CONTRIBUTING.md and add a JSON Schema for configuration files (#1485) @jamietanna
- feat: add support for Go 1.22+ net/http routing (#1475) @thedadams
🐛 Bug fixes
- Bug: using x-go-type-name results in missing types (#1397) @jamesphillpotts-fr
- fix: correctly register Fiber middleware (#1615) @jamietanna
- fix: ensure we pre-import
nullable
(#1585) @jamietanna - Prefactor: Changes from #1475 (#1480) @jamietanna
- Ensure docstring comment names are set correctly (#1457) @ConorPKeegan
📝 Documentation updates
- docs(sponsors): add a Sponsors section in README (#1635) @jamietanna
- docs(examples): document how to set up authenticated middleware with a non-
echo
server (#1627) @jamietanna - docs(extensions): add missing
x-go-type-name
docs (#1616) @jamietanna - chore: log warning when using 3.1.x (#1592) @jamietanna
- docs: link to blog post for syncing vendored specs (#1580) @jamietanna
- docs: correct
std-http-server
example (#1576) @sajjanjyothi - docs: revamp README, add a CONTRIBUTING.md and add a JSON Schema for configuration files (#1485) @jamietanna
- docs: update OpenAPI spec links to
main
branch (#1493) @dharsanb - Add Fiber example in README (#1495) @alexandregv
- Prefactor: Changes from #1475 (#1480) @jamietanna
- docs: use relative links to files (#1471) @alexandear
👻 Maintenance
- chore: add missing test case for replaceInitialism (#1624) @alexandear
- Simplify extensions merge in
mergeOpenapiSchemas
(#1424) @Juneezee - chore: log warning when using 3.1.x (#1592) @jamietanna
- refactor: extension variable instead of accessing extensions directly (#1448) @alexandear
- chore(deps): remove dependency on
golang.org/x/lint
(#1588) @jamietanna - docs: revamp README, add a CONTRIBUTING.md and add a JSON Schema for configuration files (#1485) @jamietanna
- chore: add test case for
additionalProperties
bug (#1528) @jamietanna - Prefactor: Build changes for #1475 (#1482) @jamietanna
- Prefactor: Changes from #1475 (#1480) @jamietanna
- Simplify CI build matrix + build against Go 1.22 (#1459) @jamietanna
📦 Dependency updates
16 changes
- fix(deps): update module golang.org/x/tools to v0.21.0 (#1601) @renovate
- fix(deps): update module github.com/getkin/kin-openapi to v0.124.0 (#1532) @renovate
- chore(deps): update module github.com/golangci/golangci-lint to v1.59.0 (#1625) @renovate
- chore(deps): update module github.com/golangci/golangci-lint to v1.58.2 (#1618) @renovate
- chore(deps): update module github.com/golangci/golangci-lint to v1.58.1 (#1603) @renovate
- fix(deps): update module golang.org/x/text to v0.15.0 (#1591) @renovate
- chore(deps): update module github.com/golangci/golangci-lint to v1.58.0 (#1586) @renovate
- fix(deps): update module golang.org/x/tools to v0.20.0 (#1531) @renovate
- fix(deps): update module golang.org/x/tools to v0.19.0 (#1289) @renovate
- fix(deps): update module github.com/getkin/kin-openapi to v0.123.0 (#1431) @renovate
- chore(deps): update module github.com/golangci/golangci-lint to v1.57.2 (#1466) @renovate
- fix(deps): update module github.com/stretchr/testify to v1.9.0 (#1479) @renovate
- chore(deps): update actions/checkout action to v4 (#1290) @renovate
- chore(deps): update actions/setup-go action to v5 (#1375) @renovate
- Update release-drafter/release-drafter action to v6 (#1453) @renovate
- Update module github.com/golangci/golangci-lint to v1.56.1 (#1455) @renovate