Repository navigation
fix(deps): update module github.com/oapi-codegen/oapi-codegen/v2 to v2.9.0 - #975
Merged
Merged
Conversation
Contributor
Author
ℹ️ Artifact update noticeFile name: server/go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
renovate
Bot
force-pushed
the
renovate/go-dependencies-(non-major)
branch
from
November 21, 2026 22:43
f60d412 to
a67349e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #975 +/- ##
==========================================
+ Coverage 90.87% 90.89% +0.01%
==========================================
Files 1405 1405
Lines 145273 145273
==========================================
+ Hits 132023 132049 +26
+ Misses 13242 13216 -26
Partials 8 8 🚀 New features to boost your workflow:
|
Merged
fclairamb
added a commit
that referenced
this pull request
Nov 22, 2026
🤖 I have created a release *beep* *boop* --- ## [0.53.0](v0.52.0...v0.53.0) (2026-11-22) ### Features * **auth:** OIDC-only mode with IdP group admin roles ([#966](#966)) ([1b51f89](1b51f89)) * **service:** install writes config.env, unit loads it via EnvironmentFile ([#948](#948)) ([e4b7fc4](e4b7fc4)) ### Bug Fixes * **aggregation:** drain the raw backlog in one run and log lag ([#978](#978)) ([26b93cd](26b93cd)) * **deps:** update github.com/dop251/goja digest to 79d6ad3 ([#972](#972)) ([02c6821](02c6821)) * **deps:** update go dependencies (non-major) ([#955](#955)) ([7dfbcd6](7dfbcd6)) * **deps:** update go dependencies (non-major) ([#968](#968)) ([6c09bae](6c09bae)) * **deps:** update go dependencies (non-major) ([#979](#979)) ([ee088b6](ee088b6)) * **deps:** update module github.com/oapi-codegen/oapi-codegen/v2 to v2.9.0 ([#975](#975)) ([1121e2e](1121e2e)) * **deps:** update module go.mongodb.org/mongo-driver/v2 to v2.10.1 ([#950](#950)) ([9e684c4](9e684c4)) * email validation, OAuth error display, translator crash guard, clone slugs, watchdog pauses ([#959](#959)) ([a20f951](a20f951)) * log OAuth code-exchange failures, show a refused sign-in on the invitation page ([#974](#974)) ([c4a8dca](c4a8dca)) * retry SMTP 4xx, 503 on agent auth DB errors, scope checkGroupUid to the org ([#973](#973)) ([88179aa](88179aa)) * **security:** block WebRTC around the browser egress proxy, survive an invalid status page ?lang= ([#957](#957)) ([79bdc82](79bdc82)) * **security:** keep OIDC-group admin grants revocable, mask resolved channel references, contain browser popups ([#976](#976)) ([6e0f09e](6e0f09e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
v2.8.2→v2.9.0Release Notes
oapi-codegen/oapi-codegen (github.com/oapi-codegen/oapi-codegen/v2)
v2.9.0: : OpenAPI 3.2 methods, smarter schema merging, more naming controlCompare Source
This is another large release. Most of the work went into three areas: a rewrite of how
allOf,anyOfandoneOfbecome Go types (available as an option for now), more configuration for things we used to hard-code (names, struct tags, content types, JSON encoding), and a long list of bug fixes, many of them from first-time contributors. Thank you all.The security fixes from v2.8.1 and v2.8.2 are included here as well. Those two releases were made from a separate branch, so if you're coming from v2.8.0, you get them now.
As always, the full automatically-generated changelog is at the bottom. The sections below cover what you should read before upgrading.
Before you upgrade
oapi-codegenand to build the code it generates. Go 1.27 is out, so 1.26 is the oldest supported Go release.runtimev1.9.1 or newer. Generated code now calls JSON functions that were added ingithub.com/oapi-codegen/runtimev1.9.0, so it won't compile against an older runtime. v1.9.1 is needed for the form body fix described below.strictmiddlewarepackages. Code generated byoapi-codegenv2.6.0 or earlier still imports them, so regenerate with this release first, then update the runtime.🎉 Major features
A new way of merging
allOf,anyOfandoneOf, as an option (#2563, #2581, and many in between)Turning schema composition into Go types has been our largest source of bugs for years. Fixing those bugs properly often changes the generated code, which we can't do to people whose specs already work. So we now have versions of the merging behavior, and you choose one:
v1is the original behavior, which embeds the types ofallOfmembers in a struct. It's whatold-merge-schemas: truedid; that option still works, and prints a deprecation warning.v2is what you have today, and it's still the default in this release.v3is new. It mergesallOfmembers according to whatallOfactually means, reports conflicting members as errors instead of quietly picking one, and generates union types that follow the spec more closely. For example, aoneOfthat only adds constraints no longer produces a union, and anallOfthat only adds a description to a$refis simply that$ref's type.v1andv2keep receiving bug fixes, but nothing that would break code that already works with them. The differences between the versions, with the code each one generates, are described in docs/schema-merging.md, including what to check when moving fromv2tov3.Please try
v3and tell us what breaks. It becomes the default in the next release (see the end of these notes).Dozens of
allOf/anyOf/oneOffixes, backed by a test matrix (#2562)Alongside the versioning work, we built a test matrix that puts every schema shape we know of in every position where we generate code (a component, a property, array items, request and response bodies, and so on), sends it through a generated client and strict server, and checks that it comes back unchanged. This found a lot of bugs, all fixed in this release:
allOfwhere any member had adefault, or added onlyreadOnly/writeOnly; OpenAPI 3.1type: [object, "null"]members; a schema with bothanyOfandoneOf.additionalProperties.oneOf/anyOfparameters can now be built by callers and bound by servers.This closes some of our oldest open issues, including #839, #1147, #1379 and #1619.
More control over generated names (#2683)
Three new opt-in settings under
output-options.naminganswer several long-standing requests. Each one changes a single, narrow behavior, and nothing changes unless you set it:enum-values.keep-underscoresSOME_ENUM_NAMESOMEENUMNAMESOME_ENUM_NAMEproperties.leading-underscore: drop_idUnderscoreIdIdexplicit-names: verbatimx-go-name: HARD_CODED_IDHARDCODEDIDHARD_CODED_IDWith
explicit-names: verbatim, a name you wrote by hand inx-go-nameorx-enum-varnamesis used exactly as written.Configurable struct tags (#2448)
Struct tags used to be hard-coded. The new
output-options.struct-tagssetting lets you change the built-injsonandformtags, or add your own (yaml,db,validate, and so on). Each tag is a small Go template:Without the setting, the generated tags are exactly what they were. The older
yaml-tagsflag still works; ayamlentry here takes precedence over it.Configurable content type names (#2449)
The new
output-options.content-typessetting maps media types to the short name used in generated type names (theJSONinFindPetsJSONRequestBody). This is most useful for vendor media types:application/vnd.mycompany.v1+jsoncan now produceFindPetsV1RequestBody, and gets models generated for it, instead of a name derived from the media type.OpenAPI 3.2
QUERYand custom HTTP methods (#2645)OpenAPI 3.2 adds a
queryoperation (the HTTPQUERYmethod) and anadditionalOperationsmap for any other HTTP method. Both are now supported on every server and in the client.One JSON codec for your whole program (#2665)
Generated models, clients and servers now encode and decode JSON through the runtime instead of calling
encoding/jsondirectly. The default is stillencoding/json, so nothing changes unless you ask. To use a different JSON library, call this once in yourmainpackage:This is also our intended path to
encoding/json/v2. Thanks to @CRaLFa for the implementation. A few places are not covered yet: request body binding andctx.JSONin the Echo, Gin, Fiber and Iris strict servers still use the framework's own JSON handling.Overlays no longer depend on the Speakeasy library (#2643)
Our overlay support came from a library whose dependencies broke under
go get -u(#2502). We've replaced it with a small implementation of our own, which removes that whole dependency chain from the module. Overlay targets are now written in standard JSONPath (RFC 9535); see the breaking changes below if you use overlays.More OpenAPI 3.1 support
oneOfofconstvalues now become Go enums even when the outer schema has notype, which is the common way to write them (#2520, thanks @sorochinssky).type: [string, integer]used to fail generation. They now map toany(#2522, thanks @bendrucker).examplekeyword is read under 3.1 (#2523, thanks @bendrucker).The rest of the notables
StrictHandlerFuncandStrictMiddlewareFuncare now type aliases, so one middleware works with every generated package for the same framework.application/x-www-form-urlencodedbody now writes an exploded array astopic=a&topic=bwhen the spec says so, instead of alwaystopic[0]=a&topic[1]=b.host-fqdnandhost_fqdnin one object becomeHostFqdnandHostFqdn2instead of a compile error.hasPrefixandhasSuffixare available in custom templates (#2659, thanks @yakovlef).anyinstead ofinterface{}(#2438). The two are the same type, so this only shows up in your diffs.☢️ Breaking changes
We try hard to avoid breaking changes, and when we can't, to make them narrow or configurable. These are the changes we made on purpose in this release.
Go 1.26 and runtime v1.9.0 are required (#2647, #2665)
Building
oapi-codegenneeds Go 1.26. Generated code now needs it too, because it requires runtime v1.9.0 or newer, and that runtime requires Go 1.26.Remote
$refs are refused by default (#2622)v2.8.1 added the
allow-remote-refs-fromoption and said the default would change in the next minor release. It has. A spec that references a document overhttp(s)now fails to load unless you list that document:Set it to
["*"]to get the old behavior back. References to local files are not affected. Better still, download the specs you depend on and commit them next to your own, so your build doesn't depend on a remote host.Overlay targets use standard JSONPath (#2643)
Overlay
targetexpressions are now read as RFC 9535 JSONPath. The previous library used its own dialect, which differed in a few ways, mostly in how filters work and in which names are allowed after a dot. Simple targets work unchanged. If one of yours doesn't, the error message suggests the standard form. To keep reading a whole overlay in the old dialect:Two smaller differences: an
updatethat targets a list now appends to it, as the Overlay specification says, andremoveon the document root is an error.Nullable fields no longer get
omitempty(#2505)This undoes a regression from v2.6.0. Since that release, nullable fields were tagged
omitempty, which meant a required, nullable field could disappear from the JSON entirely, and an optional one could never be sent as an explicitnull. We've gone back to the behavior from before v2.6.0: nullable fields are always written, asnullwhen unset.If you came to rely on the v2.6.0 behavior, add
x-omitempty: trueto the affected properties, or use thenullable-typeoutput option.StrictHandlerFuncandStrictMiddlewareFuncare type aliases (#2660)This is what makes strict middleware shareable between packages. It only affects code that depended on these being distinct named types, for example by declaring methods on them. Such code needs to use the underlying function type instead.
Template files were renamed and merged (#2486)
The server templates for the different routers had drifted apart over the years, and we've merged them into shared templates with small per-router pieces. Generated code is essentially unchanged, but if you override templates with
output-options.user-templates, some of the names you override no longer exist. You'll need to move your overrides to the new template names.Some
allOf/anyOf/oneOfoutput changed (#2562)The fixes above change generated code for a few shapes that used to generate something wrong:
allOfover an array keeps its item type:[]Xinstead of[]any.oneOf/anyOfnext to anallOfis merged into the type instead of being dropped.default:response that refers to a reusable response uses that response's model as its body, instead of an anonymous struct.oneOf/anyOfparameters get a named type,<Operation>Params<Name>, instead of an anonymous struct.Smaller behavior changes
format: date-timeheader used to be written in Go's default time format, which our own generated client couldn't read. It's now RFC 3339.net/httpserver rejects paths it can't route (#2492, thanks @Solaris-star). A path such as/resources/{resourceId}:applyused to generate code that panicked at startup. It's now an error at generation time.In the runtime: spaces in query parameters are sent as
%20(runtime#190)This change is in
github.com/oapi-codegen/runtimev1.10.0, not in the generator, but it affects every generated client, so it bears repeating here.Generated clients used to encode a space in a query parameter as
+. That encoding belongs to form bodies. For query parameters, OpenAPI's default style encodes a space as%20, and that's now what the runtime does. Servers that accept+also accept%20, so most people won't notice, and clients talking to strict servers that rejected+will start working. If you need the old encoding, restore it in your program:Paths and form request bodies are not affected.
🔮 Upcoming changes in the next release
Two things are planned for v2.10.0, and we're telling you now so that you can prepare.
schema-merging-behavior: v3becomes the defaultv3is an option in this release so that it can be tested on real specs. In the next release it becomes the default.v2andv1will remain available as settings, so nobody is forced to move.What you can do now:
schema-merging-behavior: v3and look at the diff in your generated code. docs/schema-merging.md explains every difference.schema-merging-behavior: v2explicitly, and the next release won't change anything for you.pkg/codegenwill shrink toGenerateand what's needed to call itpkg/codegenexports a great deal that was never meant to be a public API: internal data structures, template helpers, and functions that only the generator itself calls. Every one of them limits what we can change without breaking somebody.In the next release,
pkg/codegenwill contain only theGeneratefunction and the symbols needed to call it, such as the configuration types. Everything else will move to an internal package.If you only run the
oapi-codegencommand, this doesn't affect you. If you importpkg/codegenand use anything other thanGenerateand its configuration, please open an issue and tell us what you use and why, so we can consider keeping it public.🎉 Notable changes
anyinstead ofinterface(#2438) @mromaszewicz🚀 New features and improvements
🐛 Bug fixes
any(#2522) @bendrucker, @claude, @mromaszewicz📝 Documentation updates
👻 Maintenance
go.modfor installinggoversion (#2547) @jamietannaanyinstead ofinterface(#2438) @mromaszewicz✍ Other changes
📦 Dependency updates
53 changes
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.