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

Use norman:"pointer" for nullable fields #49

Merged
merged 1 commit into from
Jun 14, 2021

Conversation

cmurphy
Copy link
Contributor

@cmurphy cmurphy commented May 19, 2021

Opt into new "pointer" field attribute from norman that will convert any
type to a pointer in the generated client code. The generated client code
includes "omitempty" JSON tags, which means that for maps and slices,
unset and empty values are both sent to the server as unset, which
breaks the cluster create validation. With this change, there's now a
difference between a nil value and an empty allocated map or slice in the
client code. Strings can now also use this attribute instead of the
"nullablestrings" type (a85378a/2450a6e).

Depends on rancher/norman#400

rancher/rancher#32553
rancher/rancher#32440

Opt into new "pointer" field attribute from norman that will convert any
type to a pointer in the generated client code. The generated client code
includes "omitempty" JSON tags, which means that for maps and slices,
unset and empty values are both sent to the server as unset, which
breaks the cluster create validation. With this change, there's now a
difference between a nil value and an empty allocated map or slice in the
client code. Strings can now also use this attribute instead of the
"nullablestrings" type (a85378a/2450a6e).
@cmurphy cmurphy force-pushed the nullablecomplex branch from ec753c5 to 19d3133 Compare June 8, 2021 00:04
@cmurphy cmurphy changed the title Use new complex nullable types from norman Add norman field attribute "pointer" Jun 8, 2021
@cmurphy cmurphy changed the title Add norman field attribute "pointer" Use norman:"pointer" for nullable fields Jun 8, 2021
@cmurphy cmurphy requested review from thedadams and mjura June 9, 2021 00:11
Copy link
Contributor

@mjura mjura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cmurphy cmurphy requested a review from cbron June 11, 2021 16:00
@cmurphy cmurphy merged commit abd1557 into rancher:master Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants