thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Haggerty <mumb...@gmail.com>
Subject Introspection of thrift enums in Python
Date Sat, 01 Jun 2013 11:55:53 GMT
Hi,

I have a Python REST API talking to internal thrift services and am
currently packaging up thrift structs as JSON objects.

Using dict and thrift_spec works well for finding the fields in the struct,
but unfortunately the enums seem to be represented solely as ints. So even
though the enum classes have mappings, I can't inspect an arbitrary thrift
object and work out the enum class, and therefore can't determine the
string representations of the enum without hard-coding (e.g. to return
jobtype: 'FULLTIME' rather than jobtype: 2).

Am I missing something in the generated definitions? Would a patch to 'fix'
this be acceptable? Or is there some better alternative?

Thanks,
James.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message