Skip to content

Deserializing failes with header wichi has underscore for its name #10

@kimsama

Description

@kimsama

Recently, I've cloned GDataDB from github and import it to Unity3D which is based on Mono.

It works fine except one.

The problem is that a property which has '_' for its name didn't work properly as it is expected.

See the following as an example:

public class MissionData
{
public int id { get; set; }
public string key { get; set; }
public string screen_name { get; set; }
public string enemy_keys { get; set; }
public int cost_energy { get; set; }
public int rewardxp { get; set; }
public int reward_money { get; set; }
public string reward_package_key { get; set; }
}

The class MissionData has several properties which has '_' for its name as 'screen_name'.

Then tried to retrieved data from the google spreadsheet as the sample code:

var client = new DatabaseClient(username, password);
var db = client.GetDatabase(testSheetName);
var table = db.GetTable(tableName);
var all = table.FindAll();
...

The value of the properties 'id' and 'key' are collect what it's value on the spreadsheet but 'screen_name' has nothing.

So I removed all '_' from properties name and then it works.

The problem was that Serializer.Deserialize(in Serializer.cs) does not retrieve correct property if the property has underscore within its name.

Is that known issue or any way to fix that problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions