-
Notifications
You must be signed in to change notification settings - Fork 411
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
🐛 Allow setting the type for structs that implement json.Marshaler #601
🐛 Allow setting the type for structs that implement json.Marshaler #601
Conversation
Currently controller-gen complains about structs with missing json tags even when those structs implement custom JSON marshalling. With this change we check if a type implements custom JSON marshalling and if it does, we output schema for Any type. This still allows the validation type to be overriden with a marker.
This slightly extends the initial work in PR 427 to fall back to the standard generation rather than producing a schema with Any in it, as that is invalid and led us to revert that PR.
@alvaroaleman: GitHub didn't allow me to request PR reviews from the following users: markusthoemmes. Note that only kubernetes-sigs 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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, vincepri 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 |
This change re-introduces #427 which was reverted in #505 because it generates a schema with
Any
in it which the kube api server won't allow. The change compared to the original work is in the last commit: We will fallback to the standard generation when there is no marker, rather than inserting the invalidAny
.Fixes #552
Fixes #560
Original issue: #391
/assign @vincepri
/cc @markusthoemmes