-
Notifications
You must be signed in to change notification settings - Fork 40.6k
Published swagger should not include sibling elements alongside a $ref #106387
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
Comments
/assign @Jefftree |
Summarizing the discussion with @apelisse and @sttts: This "bug" is a feature we rely on in
Every field that references another struct (and isn't a map/list) would have their description stripped to be compliant with the schema. Some are self-explanatory fields but there are certain fields that benefit from the description because they describe specifically how the embed resource is used specifically embed in the selected resource rather than in general. Solutions:
Ref: |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/close |
@Jefftree: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
From what I understand, this issue was solved by kubernetes/kube-openapi#298 Opened #126731 to reactivate the integration test that was disabled because of this issue |
What happened?
Per JSON Reference documentation,
In the first couple of lines in our swagger.json, we publish a spec that contains a schema with $ref and also an additional description field which is disallowed.
Eg:
The $ref field is only permitted to have sibling elements after JSON Schema draft 2019-09 which corresponds to OpenAPI 3.1.
The description field (or any field alongside a $ref) should not be published for OpenAPI 2.0 and 3.0 as it is an invalid field. Due to a bug in the gnostic openapiv2 library, the sibling fields are not dropped when converting our openapi to proto in v2, but are dropped in the openapiv3 library. This causes inconsistent behavior when round tripping our specs to proto and back.
I'm not exactly sure if anything (either k/k or downstream OpenAPI clients) depend on this bug and would like to have a discussion first before providing a fix.
/sig api-machinery
What did you expect to happen?
See above
How can we reproduce it (as minimally and precisely as possible)?
See above
Anything else we need to know?
No response
Kubernetes version
1.23
Cloud provider
OS version
Install tools
Container runtime (CRI) and and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: