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

Generated structs should have the omitempty tag option #12

Closed
andreykaipov opened this issue Jun 15, 2021 · 1 comment
Closed

Generated structs should have the omitempty tag option #12

andreykaipov opened this issue Jun 15, 2021 · 1 comment

Comments

@andreykaipov
Copy link
Owner

Would avoid situations like this described in #5 (comment)

@andreykaipov
Copy link
Owner Author

Every field now has omitempty by default except any boolean field, which all omit omitempty.

For example, in the case of SetSceneItemProperties, the Visible field can't have omitempty because making it invisible would involve setting it to false, at which point the JSON encoder will omit it from the sent request.

I imagine there's a few integer fields whose empty value (0) happens to be a valid value in a request, so in the future more fields may omit omitempty, but that's something to worry about later ... 😄

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

No branches or pull requests

1 participant