ServiceStack/ServiceStack.Text — Issue #44: serializing enums as integers
Author: dlogar
Created: 2011-10-31 22:51:25+00:00
State: open

Our project is using a public api specification, that also has enum values 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.