🐛 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. DetailsIn 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. |
|
[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 DetailsNeeds 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
Anyin 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