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

Feature/add ref id style conversion #44

Merged
merged 5 commits into from
Apr 13, 2017

Conversation

Roblinde
Copy link
Collaborator

No description provided.

@aKzenT
Copy link
Contributor

aKzenT commented Apr 12, 2017

I didn't have a chance to test it yet, but it looks good so far. I will try it this evening.

One last thing I'm currently doing in a custom converter which I think would be very useful to support in general, is to have more control over what type is created during deserialization based on the Contentful ContentType.

In my example, if I have an Items collection I want to have various types of content within the collection, each with its own content type. My vision would be to have something like a IContentTypeResolver interface that I can set on the client which takes in a content type from contentful and returns the corresponding .NET Type to deserialize into.

This should again be easy to support using JSON.NET if we add a $type property to the JSON objects returned from Contentful.

Of course we could handle this as a separate feature request. Just wanted to mention it while we are working on deserialization anyway.

@Roblinde
Copy link
Collaborator Author

Great, looking forward to feedback.

A separate feature request would be great for that, I'll add an issue so as to not forget about it. In general the suggestion sounds great. It could probably be beneficial in many scenarios where you get mixed content back.

@aKzenT
Copy link
Contributor

aKzenT commented Apr 13, 2017

Hey,

sorry for the late response. I just tried the new version and it works like a charm for me!

@Roblinde
Copy link
Collaborator Author

Excellent! I'll make sure to package this and release a new version shortly.

Many thanks for the contributions.

@Roblinde Roblinde merged commit bd76dfc into master Apr 13, 2017
@Roblinde Roblinde deleted the feature/add-ref-id-style-conversion branch April 13, 2017 17:23
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.

None yet

2 participants