This project has moved. For the latest updates, please go here.

Deserializing to Ruby Naming convention using a convention :)

Oct 13, 2010 at 10:57 AM

I am using and I am talking to a Ruby based Rest API. Problem is that most of the propertys have a ruby underscore naming convention. I am wondering if anyone knows of a way so that I can avoid having to Add lots of JsonProperty.

For example I want to avoid adding the JsonProperty attribute and have a convention built into the serializer settings so that it knows to try and map properties with an underscore in the to the .NET naming convention :)

public class Member
[JsonProperty(PropertyName = "avatar_url")]
public string AvatarUrl { get; set; }

[JsonProperty(PropertyName = "twitter_screen_name")]
public string TwitterScreenName { get; set; }

[JsonProperty(PropertyName = "website_url")]
public string WebSiteUrl { get; set; }