v2.4.0: OpenAPI Overlay, improved import-mapping functionality, and a whole host of other great things 馃殌
#1777
jamietanna
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
馃帀 Notable changes
Modifying the input OpenAPI Specification, without needing to modify it directly
Prior to
oapi-codegenv2.4.0, users wishing to override specific configuration, for instance taking advantage of extensions such asx-go-typewould need to modify the OpenAPI specification they are using.In a lot of cases, this OpenAPI specification would be produced by a different team to the consumers (or even a different company) and so asking them to make changes like this were unreasonable.
This would lead to the API consumers needing to vendor the specification from the producer (which is our recommendation anyway) and then make any number of local changes to the specification to make it generate code that looks reasonable.
However, in the case that a consumer would update their specification, they would likely end up with a number of merge conflicts.
Now, as of
oapi-codegenv2.4.0, it is now possible to make changes to the input OpenAPI specification without needing to modify it directly.This takes advantage of the OpenAPI Overlay specification, which is a stable specification.
We're very excited for y'all to be able to take advantage of this, and to be able to manipulate complex specifications you don't have control over.
Using a single package, with multiple OpenAPI spec for a given package
Since
oapi-codegenv2.4.0, it is now possible to split large OpenAPI specifications into the same Go package, using the "self" mapping (denoted by a-) when using Import Mapping.This is an improvement on the previous model, which would require splitting files across multiple packages.
This should improve the ability to use a multi-file OpenAPI specification.
Reverting a breaking change to Strict servers using
text/plainChanges in #1132 had unintended side effects, and so we have reverted this.
This will be a breaking change to anyone who had pulled in this change, since it landed in v1.13.1.
Minimum version of Go needed for
oapi-codegenis now 1.21Does what it says on the tin.
This was required for a new dependency, and given Go 1.21 is now End-of-Life, this isn't too bad a requirement, without requiring folks unnecessarily bump their minimum supported version higher.
Starting work towards the OpenSSF Best Practices badge
As a means to better understand the compliance of
oapi-codegenwith OpenSSF's Best Practices guide, we've started work towards the "passing" badge.This gives us some insight into where we have gaps, and makes it known for our users, too.
PR Builds now have required status checks
Previously, PR builds did not have a required status check.
Although as maintainers we would only merge changes after the CI checks had passed, this now gives us - and you as our users - greater confidence in the stability of the project.
Previously raised PRs - before 2024-09-20 - will need to merge in the latest changes in
mainbefore these status checks will pass.馃殌 New features and improvements
import-mappingto the current package (feat: allowimport-mappingto the current package聽#1774) @jamietanna @djgilcreaseMuxinterface instead of*http.ServeMux(feat(std-http): acceptMuxinterface instead of*http.ServeMux聽#1720) @sonalys<and>in property or type names (feat: handle<and>in property or type names聽#1740) @ansonix-oapi-codegen-only-honour-go-name(feat(extension): addx-oapi-codegen-only-honour-go-name聽#1697) @jamietanna馃悰 Bug fixes
anyOfs (fix: correctly generate structs and properties foranyOfs聽#1178) @daleef-rahmancookievariables in block scope (fix(cookies): wrapcookievariables in block scope聽#1687) @andremarianiellox-orderfrom next to$ref, if present (fix(extensions): use thex-orderfrom next to$ref, if present聽#1700) @paulmach馃摑 Documentation updates
deepmap/oapi-codegenreferences (docs: removedeepmap/oapi-codegenreferences聽#1771) @jamietannain: cookie(docs(tests): add an example of usingin: cookie聽#1770) @jamietannaFUNDING.yml(docs(sponsors): addFUNDING.yml聽#1661) @jamietanna馃懟 Maintenance
馃摝 Dependency updates
9 changes
Sponsors
We would like to thank our sponsors for their support during this release.
This discussion was created from the release v2.4.0: OpenAPI Overlay, improved `import-mapping` functionality, and a whole host of other great things 馃殌.
All reactions