feat!: extract anonymous structs into types#131
Draft
jamietanna wants to merge 2 commits into
Draft
Conversation
So we can generate examples, too.
As noted in PRF-1954, this long-time issue in `oapi-codegen` upstream has led to cases where we would have an anonymous struct generated, which can make it hard to interact with these types. We can utilise the new `generate-types-for-anonymous-schemas` functionality to introduce the explicit types. This is a breaking change, as it may require users to handle a one-time migration, but leads to a much more consistent and usable interface.
8774497 to
30df94c
Compare
kwent
approved these changes
Jul 11, 2026
kwent
left a comment
Member
There was a problem hiding this comment.
as long as SemVer correctly with good changelog and why it's breaking i don't have any issues
Collaborator
Author
Would you be hoping for a full list of types that are impacted? (we should be able to generate this from the Abstract Syntax Tree, I wonder if we can help folks migrate automagically too) |
Member
|
the more the better always yes good idea |
287fee0 to
38435f9
Compare
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.
As noted in PRF-1954, this long-time issue in
oapi-codegenupstreamhas led to cases where we would have an anonymous struct generated,
which can make it hard to interact with these types.
We can utilise the new
generate-types-for-anonymous-schemasfunctionality to introduce the explicit types.
This is a breaking change, as it may require users to handle a one-time
migration, but leads to a much more consistent and usable interface.