Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CRD Schema Generator - Ignore Non-Exported Fields #3190

Closed
ryantse opened this issue May 28, 2021 · 0 comments · Fixed by #3191
Closed

CRD Schema Generator - Ignore Non-Exported Fields #3190

ryantse opened this issue May 28, 2021 · 0 comments · Fixed by #3191

Comments

@ryantse
Copy link
Contributor

ryantse commented May 28, 2021

In certain CRD structs in Go, a developer may choose to not to have a field be part of the schema by using "-" as the JSON field name. Currently, the generator does not handle this case and improperly generates a JSON Schema that has this as a field name, this subsequently fails during JSON Schema to POJO generation as a field should not be called "-".

A concrete example of this use can be found in the RolloutSpec for Argo Rollouts: https://github.com/argoproj/argo-rollouts/blob/master/pkg/apis/rollouts/v1alpha1/types.go#L36-L37

The generator should be made aware of this functionality and not export these fields to the JSON Schema.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant