ServiceStack/ServiceStack.Text — Issue #49: JSON serializer does not enforce  [DataMember(Name = "XXX")] attribute
Author: froyke
Created: 2011-12-01 09:32:18+00:00
State: open

I don't know if it is a bug or WAD but configuration that works for XML/JSON BCL serializer's does not apply to SS' JSON Serializer.

This example demonstrate the issue:

public IPAddress IP
{
get { return IPAddress.Parse(ip_str_internal); }
set { ip_str_internal = value.ToString(); }
}

[DataMember(Name = "IP")]
public string ip_str_internal
{
get ;
set;
}

The SS' serializer JSOn response has the 'ip_str_internal' property instead of IP.

If this works as design (and there is another way to configure the serializer) then I think it is not comfortable for the users to maintain 2 attributes configurations (1 for the XML and 1 for JSON)