Repository navigation
OpenAPI: Add missing type: object to AssertViewUUID - #18099
Conversation
AssertViewUUID is the only schema the ViewRequirement discriminator maps to, but it does not say it is an object. OpenAPI requires a discriminator target to be an object schema or an allOf, so tools cannot tell what this schema is. This looks like a leftover from apache#11955. The wire format and the meaning of the schema do not change, and the generated Python code is unchanged.
| - $ref: '#/components/schemas/AssertViewUUID' | ||
|
|
||
| AssertViewUUID: | ||
| type: object |
There was a problem hiding this comment.
what about other Assert* definitions like AssertTableUUID or AssertRefSnapshotId? Or does AssertViewUUID actually need
allOf:
- $ref: '#/components/schemas/ViewRequirement'
There was a problem hiding this comment.
Thanks for taking a look!
AssertTableUUID, AssertRefSnapshotId etc. don't need it. They all have allOf: [$ref TableRequirement], and TableRequirement is type: object, so they inherit it. AssertViewUUID can't inherit anything because ViewRequirement is a oneOf union rather than a base class. Other oneOf members in this spec (EmptyPlanningResult, AsyncPlanningResult) declare type: object themselves, so this follows the existing convention. AssertViewUUID was the only discriminator target with neither allOf nor type: object.
allOf: [$ref ViewRequirement] would create a cycle, since ViewRequirement already has oneOf: [$ref AssertViewUUID]. If you do that you will see generation failing with maximum recursion depth exceeded.
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions. |
AssertViewUUID is the only schema the ViewRequirement discriminator maps to, but it does not say it is an object. OpenAPI requires a discriminator target to be an object schema or an allOf, so tools cannot tell what this schema is. This looks like a leftover from apache#11955. The wire format and the meaning of the schema do not change, and the generated Python code is unchanged.
AssertViewUUID is the only schema the ViewRequirement discriminator maps to, but it does not say it is an object. OpenAPI requires a discriminator target to be an object schema or an allOf, so tools cannot tell what this schema is.
This looks like a leftover from #11955.
The wire format and the meaning of the schema do not change, and the generated Python code is unchanged.