-
Notifications
You must be signed in to change notification settings - Fork 219
Wrap Refs with AllOf #298
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
Wrap Refs with AllOf #298
Conversation
pkg/builder3/openapi.go
Outdated
*schema = *orig | ||
} | ||
} | ||
if schema.Ref.String() != "" && (schema.Nullable != false || schema.Default != nil || len(schema.Extensions) > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm questioning if we have a better way to do these checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could check if, when removing the ref, you have an empty schema. Or you could copy the ref to an empty schema and compare it with your actual schema? I'm assuming that what you're actually checking is that there is no other field along with the ref, your condition will need to be updated anytime we add such a new thing in our openapi.
@Jefftree: GitHub didn't allow me to request PR reviews from the following users: alexzielenski. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm mostly concerned about the condition for creating the ref, but looks good beside that.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apelisse, Jefftree The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Refs should not have sibling elements other than description: kubernetes/kubernetes#106387. Wrap Refs in AllOf to preserve gnostic round trip.