Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Struct literals #77

Open
abhinav opened this issue Oct 19, 2015 · 1 comment
Open

Struct literals #77

abhinav opened this issue Oct 19, 2015 · 1 comment

Comments

@abhinav
Copy link
Contributor

abhinav commented Oct 19, 2015

Apache Thrift supports struct literals in thrift files.

For example,

struct Date {
    1: byte day
    2: byte month
    3: i16 year
}

const Date foo = {'day': 1, 'month': 1, 'year': 1234}

The generated code includes,

ttypes.foo = new ttypes.Date({
'day' : 1,'month' : 1,'year' : 1234});
@abhinav
Copy link
Contributor Author

abhinav commented Oct 19, 2015

Related thriftrw/thriftrw-python#58

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

No branches or pull requests

1 participant