Skip to content
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

Merged
merged 1 commit into from
Mar 26, 2022
Merged

Wrap Refs with AllOf #298

merged 1 commit into from
Mar 26, 2022

Conversation

Jefftree
Copy link
Member

@Jefftree Jefftree commented Mar 25, 2022

Refs should not have sibling elements other than description: kubernetes/kubernetes#106387. Wrap Refs in AllOf to preserve gnostic round trip.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 25, 2022
@Jefftree Jefftree changed the title Wrap Refs with AllOf [WIP] Wrap Refs with AllOf Mar 25, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 25, 2022
@Jefftree Jefftree changed the title [WIP] Wrap Refs with AllOf Wrap Refs with AllOf Mar 25, 2022
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 25, 2022
*schema = *orig
}
}
if schema.Ref.String() != "" && (schema.Nullable != false || schema.Default != nil || len(schema.Extensions) > 0) {
Copy link
Member Author

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.

Copy link
Member

@apelisse apelisse Mar 26, 2022

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.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 25, 2022
@Jefftree
Copy link
Member Author

/cc @apelisse @jiahuif @alexzielenski

@k8s-ci-robot
Copy link
Contributor

@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:

/cc @apelisse @jiahuif @alexzielenski

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.

pkg/builder3/openapi.go Outdated Show resolved Hide resolved
Copy link
Member

@apelisse apelisse left a 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.

@apelisse
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 26, 2022
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2022
@k8s-ci-robot k8s-ci-robot merged commit e69a86c into kubernetes:master Mar 26, 2022
@Jefftree Jefftree deleted the allOf branch March 21, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants