Repository navigation
Fix several issues with oneof responses #924
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
ezilber-akamai
merged 7 commits into
linode:dev
from
ezilber-akamai:fix/cli-oneof-response-property-overwriting
Sep 16, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2746113
Fixed issue with oneof responses getting overwritten during schema ag…
ezilber-akamai 5534993
Fix lint
ezilber-akamai d895668
Fixed oneOf handling in _parse_response_model
ezilber-akamai 5fb04df
Merge branch 'dev' into fix/cli-oneof-response-property-overwriting
ezilber-akamai fa87fee
Addressed CoPilot suggestions
ezilber-akamai 8bad042
Merge branch 'dev' into fix/cli-oneof-response-property-overwriting
ezilber-akamai b813bb2
More CoPilot fixes
ezilber-akamai 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
Some comments aren't visible on the classic Files Changed page.
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,97 @@ | ||
| openapi: 3.0.1 | ||
| info: | ||
| title: API Specification | ||
| version: 1.0.0 | ||
| servers: | ||
| - url: http://localhost/v4 | ||
|
|
||
| paths: | ||
| /foo/bar: | ||
| x-linode-cli-command: foo | ||
| put: | ||
| summary: Update something. | ||
| operationId: fooBarPut | ||
| description: This is description | ||
| requestBody: | ||
| description: Some description. | ||
| required: True | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Interface' | ||
| responses: | ||
| '200': | ||
| description: Successful response | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/Interface' | ||
|
|
||
| components: | ||
| schemas: | ||
| # This schema reproduces the real-world case where a response is a oneOf | ||
| # of variants, and every variant defines the SAME set of top-level keys, | ||
| # but only fully populates the one relevant to that variant while nulling | ||
| # out the others. A naive dict.update() merge lets the last branch | ||
| # overwrite the fully-populated definitions from earlier branches. | ||
| Interface: | ||
| oneOf: | ||
| - title: Variant A | ||
| type: object | ||
| properties: | ||
| variant_a: | ||
| type: object | ||
| properties: | ||
| ranges: | ||
| type: array | ||
| items: | ||
| type: object | ||
| properties: | ||
| range: | ||
| type: string | ||
| description: The variant A range. | ||
| variant_b: | ||
| type: object | ||
| nullable: true | ||
| # An array whose items are a oneOf of SCALAR types. This must be | ||
| # treated as a normal array attribute, not recursed into. | ||
| scalar_choices: | ||
| type: array | ||
| items: | ||
| oneOf: | ||
| - type: string | ||
| - type: integer | ||
| # This shared object is defined more richly in the LATER branch | ||
| # The fuller definition must win regardless of branch | ||
| # order, so all of its nested fields must survive aggregation. | ||
| shared_obj: | ||
| type: object | ||
| properties: | ||
| only_a: | ||
| type: string | ||
| description: Present in both branches. | ||
| - title: Variant B | ||
| type: object | ||
| properties: | ||
| variant_a: | ||
| type: object | ||
| nullable: true | ||
| variant_b: | ||
| type: object | ||
| properties: | ||
| label: | ||
| type: string | ||
| description: The variant B label. | ||
| shared_obj: | ||
| type: object | ||
| properties: | ||
| only_a: | ||
| type: string | ||
| description: Present in both branches. | ||
| extra_b1: | ||
| type: string | ||
| description: Only defined in the richer Variant B branch. | ||
| extra_b2: | ||
| type: string | ||
| description: Only defined in the richer Variant B branch. | ||
|
|
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
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.