#1 2015-06-15 08:28:10

willo
Member
From: Cape Town, South Africa
Registered: 2014-11-15
Posts: 67
Website

Serializing Enums as String

Is there an easy way to have mORMot encode Enums as String? I see it's part of the standard serializer, but I can't seem to find a place to customize the serializer's options.

Offline

#2 2015-06-15 13:28:01

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: Serializing Enums as String

Which serialization?
Orm? Soa? ObjectToJson?

Offline

#3 2015-06-17 08:02:05

willo
Member
From: Cape Town, South Africa
Registered: 2014-11-15
Posts: 67
Website

Re: Serializing Enums as String

SOA using interface based services seem to be using TServiceMethodArgument.AddJSON specifically. Browsing through the code and these forums I noticed that it can encode Enums as String, if the soWriteHumanReadable option is set, but I can't seem to find a hook to customize the Options.

Offline

Board footer

Powered by FluxBB