-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: allow x-go-type and x-go-type-skip-optional-pointer for allOf #1610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mromaszewicz
merged 7 commits into
oapi-codegen:main
from
turip:fix-allof-type-override
Apr 29, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
de857df
fix: allow x-go-type and x-go-type-skip-optional-pointer for allOf
turip 1cb4516
Add unit tests
turip f489c0f
Merge remote-tracking branch 'origin/HEAD' into fix-allof-type-override
e87c19f
Merge branch 'main' into fix-allof-type-override
0c9b5b0
Merge branch 'main' into fix-allof-type-override
mromaszewicz cc6e460
Merge remote-tracking branch 'upstream/main' into pr/1610
mromaszewicz a479ef0
update PR for upstream changes
mromaszewicz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| paths: | ||
| /pets: | ||
| patch: | ||
| requestBody: | ||
| content: | ||
| application/json: | ||
| schema: | ||
| oneOf: | ||
| - $ref: '#/components/schemas/Cat' | ||
| - $ref: '#/components/schemas/Dog' | ||
| discriminator: | ||
| propertyName: pet_type | ||
| responses: | ||
| '200': | ||
| description: Updated | ||
| components: | ||
| schemas: | ||
| Pet: | ||
| x-go-type: pet.Pet | ||
| x-go-type-import: | ||
| path: github.com/somepetproject/pkg/pet | ||
| type: object | ||
| required: | ||
| - pet_type | ||
| properties: | ||
| pet_type: | ||
| type: string | ||
| discriminator: | ||
| propertyName: pet_type | ||
| Dog: # "Dog" is a value for the pet_type property (the discriminator value) | ||
| x-go-type: dog.Dog | ||
| x-go-type-import: | ||
| path: github.com/somepetproject/pkg/dog | ||
| allOf: # Combines the main `Pet` schema with `Dog`-specific properties | ||
| - $ref: '#/components/schemas/Pet' | ||
| - type: object | ||
| # all other properties specific to a `Dog` | ||
| properties: | ||
| bark: | ||
| type: boolean | ||
| breed: | ||
| type: string | ||
| enum: [Dingo, Husky, Retriever, Shepherd] | ||
| Cat: # "Cat" is a value for the pet_type property (the discriminator value) | ||
| x-go-type: cat.Cat | ||
| x-go-type-import: | ||
| path: github.com/somepetproject/pkg/cat | ||
| allOf: # Combines the main `Pet` schema with `Cat`-specific properties | ||
| - $ref: '#/components/schemas/Pet' | ||
| - type: object | ||
| # all other properties specific to a `Cat` | ||
| properties: | ||
| hunts: | ||
| type: boolean | ||
| age: | ||
| type: integer |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.