Skip to content

Conversation

shaylevi2
Copy link
Contributor

Added support for select tokens using a '.' in the Name parameter of "DeserializeAs" attribute

Tests created to match that case as well. Might save a lot of trouble, you can now map yourself to the data through attributes instead of changing the model.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Out of curiosity, what happens if there happens to be a user property with a following property. I assume this supercedes that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the question correctly you mean something like this:

public class complexStatus
{
[DeserializeAs(Name="user.following")]
public bool follow { get; set; }

public User user { get; set; } // Contains a "following" field

}

Both will work.
The DeserializeAs is only relevant for the property it is assigned to.

haacked added a commit that referenced this pull request Jan 29, 2014
SelectTokens support ("path.to.data") added (with tests)
@haacked haacked merged commit b990048 into restsharp:master Jan 29, 2014
@haacked
Copy link
Contributor

haacked commented Jan 29, 2014

👍

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

Successfully merging this pull request may close these issues.

2 participants