Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize String as Key Dictionaries Cleanly #16

Closed
izackp opened this issue Feb 14, 2015 · 4 comments
Closed

Serialize String as Key Dictionaries Cleanly #16

izackp opened this issue Feb 14, 2015 · 4 comments

Comments

@izackp
Copy link

izackp commented Feb 14, 2015

By default fullserializer will not deserialize something like this json:

{
  "controls": {
    "Action1": "Roll",
    "Action2": "Throw Knife",
    "Action3": "Smoke Bomb",
    "Action4": "4"
  }
}

into a dictionary for a class like this:

public class CharacterDesc {
    [fsProperty("controls")]
    public Dictionary<string, string> Controls;
}

I implemented myself, but I'm too lazy to rearrange my code and make a pull request:
https://gist.github.com/izackp/39e1e150b41fced0680a

@jacobdufault
Copy link
Owner

Okay, I'll take a look into integrating this. If I do so, I'd probably just integrate it directly into the IEnumerable converter instead of making users deal with a special dictionary class.

@izackp
Copy link
Author

izackp commented Feb 15, 2015

Ya, I'm a pretty new c# developer :S so I didn't know the best way to accomplish it.

@jagt
Copy link
Contributor

jagt commented Mar 8, 2015

+1 for this. It would really handy to work with hand written JSON files with this integrated.

@jacobdufault
Copy link
Owner

Yep, I plan on integrating this when I get some time to work on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants