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

Working with unions #12

Open
ghost opened this issue Nov 3, 2015 · 1 comment
Open

Working with unions #12

ghost opened this issue Nov 3, 2015 · 1 comment
Assignees

Comments

@ghost
Copy link

ghost commented Nov 3, 2015

I'm fine playing around with structs, but when I add the following to the thrift file:

union Identity {
  1: string email;
  2: string ssn;
}

I can't instantiate the Identity union. It feels like I should be able to use:

(thrift/->thrift (map->Identity {:ssn "21582"}))

but this throws the error "Not an optional field: email"

Does the library currently support unions? If so, I'd be happy to add documentation to the readme.

@xsc xsc self-assigned this Nov 14, 2015
@xsc
Copy link
Owner

xsc commented Nov 14, 2015

I have to look into it again, but IIRC it was hard to distinguish between unions and structs via reflection (which thrift-clj relies on), since they are using the same type ID.

But yes, this was on the initial road map, I just never got around to it. That said, contributions are welcome. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant