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

fix: default values for unions should only be used when no fields are set #163

Merged
merged 4 commits into from
Jun 17, 2019

Conversation

kevin-greene-ck
Copy link
Contributor

Resolves #162

Fixes an issue where defined defaults in unions could result in multiple fields being set.

@kevin-greene-ck kevin-greene-ck changed the title fix: default values for unions whould only be used when no fields are set fix: default values for unions should only be used when no fields are set Jun 17, 2019
@kevin-greene-ck
Copy link
Contributor Author

@hayes This is what I came up with. Look okay to you? Test fixture for this: https://github.com/creditkarma/thrift-typescript/pull/163/files#diff-8b97c3b8f61620cfd5530231d88df535

@hayes
Copy link
Contributor

hayes commented Jun 17, 2019

looks good to me!

testing it out now on our code base.

@hayes
Copy link
Contributor

hayes commented Jun 17, 2019

confirmed that this works with all our schemas! thanks for getting this together so quickly.

@kevin-greene-ck
Copy link
Contributor Author

Cool, I'll publish in a few minutes.

@kevin-greene-ck kevin-greene-ck merged commit 9f2a785 into master Jun 17, 2019
@kevin-greene-ck
Copy link
Contributor Author

Released in 3.7.1

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.

Initializers in unions don't work as expected
2 participants