ServiceStack/ServiceStack — Issue #40: serialize enums to integers
Author: dlogar
Created: 2011-10-31 22:47:23+00:00
State: open

Our application is using a public api specification, that also has enums defined. Communication goes over http, however clients or servers are written in many languages (C, Java, Lua,..)

Currently servicestack serializes enums as strings (see field "type"):
"geo": {
"lat": 0,
"postalcode": "1000",
"type": "GEOLOCATION_TYPE_GPSLOCSERV"
},

Our request would be to have option, to have enums serialized as integers.
"geo": {
"lat": 0,
"postalcode": "1000",
"type": 3
},

Same issue has been also asked in "ServiceStack serializer incompatability with Microsoft .NET DataContractSerializer when using enums" at http://groups.google.com/group/servicestack/browse_thread/thread/260308b2b694c38a where John describes that DataContractSerializer also serializes enums as integers.