Skip to content

OpenAPI v3.1 support, experimental re-implementation using libopenapi#2197

Merged
mromaszewicz merged 30 commits intooapi-codegen:mainfrom
mromaszewicz:experimental-v3
Feb 7, 2026
Merged

OpenAPI v3.1 support, experimental re-implementation using libopenapi#2197
mromaszewicz merged 30 commits intooapi-codegen:mainfrom
mromaszewicz:experimental-v3

Conversation

@mromaszewicz
Copy link
Copy Markdown
Member

@mromaszewicz mromaszewicz commented Feb 7, 2026

This is a prototype for a V3 versions of oapi-codegen, which addresses several issues, but mainly #373.

Please see the README.me in experimental/ for usage and changes.

deepmap-marcinr and others added 30 commits February 3, 2026 22:24
Allow users to control which content types are included in
model generation for requests, responses.
Users can now fully control the struct tags that are generated, with
default values of json and form encoding
Generated code must have a header saying it's generated.
Simplify names of schemas discovered by traversing the paths element
of the spec.
Ensure that we're fixing existing open issues.
Recreate old issue tests to make sure everything still works
as expected.
Add a Nullable type and use it where explicitly requested.
Add extension properties which match the old oapi-codegen behavior, and
fix a bunch of related issues.
Parameter binding and styling will now be embedded into the generated
code, and not rely on an external runtime package.
Add first server support, using built in http, and refine templates
to make it work. Example perstore implementation.
Models can be imported into clients now, so they can live in
a separate package.

Clean up example client to use the models import, and clean up
tests.
Libopenapi now supports parsing the model without resolving
external references, which is exactly what we wanted.
Add webhook and callback support, and show examples of how to
use them.
This was an unnecessary complication and we'll cross this bridge if
we ever get to it.

Also, fix lint issues.
echo V5 needs go 1.25, so we can only validate it if
running the 1.25 toolchain
@mromaszewicz mromaszewicz requested a review from a team as a code owner February 7, 2026 00:55
@socket-security
Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Critical
Critical CVE: Fiber Utils UUIDv4 and UUID Silent Fallback to Predictable Values in golang github.com/gofiber/utils/v2

CVE: GHSA-m98w-cqp3-qcqr Fiber Utils UUIDv4 and UUID Silent Fallback to Predictable Values (CRITICAL)

Affected versions: < 2.0.0-rc.4

Patched version: 2.0.0-rc.4

From: ?golang/github.com/gofiber/fiber/v3@v3.0.0-beta.4golang/github.com/gofiber/utils/v2@v2.0.0-beta.7

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore golang/github.com/gofiber/utils/v2@v2.0.0-beta.7. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@mromaszewicz mromaszewicz self-assigned this Feb 7, 2026
@mromaszewicz
Copy link
Copy Markdown
Member Author

Since this doesn't affect existing users at all, I am merging it to gather feedback.

@mromaszewicz mromaszewicz merged commit 5206145 into oapi-codegen:main Feb 7, 2026
23 checks passed
Copy link
Copy Markdown
Member

@jamietanna jamietanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per discussion on Slack, let's move this into a separate repo to keep the main repo clean, and allow folks to opt in

jamietanna added a commit that referenced this pull request Feb 7, 2026
@jamietanna
Copy link
Copy Markdown
Member

@mromaszewicz where we're using AI-written code, please make sure it's called out in the PR and/or co-authored-by in the commit messages, please

jamietanna added a commit that referenced this pull request Feb 7, 2026
@jamietanna
Copy link
Copy Markdown
Member

We've moved this into a separate fork for the time being: https://github.com/oapi-codegen/oapi-codegen-exp

szarowski pushed a commit to szarowski/oapi-codegen that referenced this pull request Feb 10, 2026
…oapi-codegen#2197)

This is a prototype implementation of a future versions of oapi-codegen. It's almost a full rewrite, heavily
inspired by previous code, and lessons learned.

- much more flexibility in configuring generated code
- move from kin-openapi to libopenapi to support 3.1 and 3.2 specs
- webhook support
- callback support
- incompatible codegen changes to aggregate types (allOf, anyOf, oneOf)
- many existing codegen bugs around schemas fixed
szarowski pushed a commit to szarowski/oapi-codegen that referenced this pull request Feb 10, 2026
This was referenced Feb 24, 2026
@renom

This comment was marked as off-topic.

@jamietanna
Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants