-
Notifications
You must be signed in to change notification settings - Fork 306
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
Configure parsing of collections #97
Comments
This should be supported once work on generics is done, as you'll be able to treat Lists just like any other generic type. Cool to hear Twitter's using it! |
Ah, that's great news! So, just to confirm, you're working on both the Thanks!
|
Sorry, I spoke too soon. I had forgotten that I'm trying to work through the best way to add support for this. It will be trivial to handle the case were the developer calls In the meantime, you should be able to use your custom
to
I know it's not the cleanest, but it'll work if you need a quick and dirty workaround until an official solution is ready. |
Ah, I was wondering about your plans for dealing with that. I thought about César On Mon, Nov 9, 2015 at 4:33 PM, Eric Kuck [email protected] wrote:
|
Twitter uses LoganSquare heavily to generate model objects from Json. In particular, we use type converters to avoid the need for copying lists when converting them to model objects. For example:
This works as expected by declaring a type converter for Tweet that uses JsonTweet. The one thing we don't have control over is the creation of the list: I would like to be able to configure LoganSquare to use my own implementation of List; in particular, I would like to be able to guarantee that all parsed lists are immutable.
More in general, I would like to have the means to declare how to parse arbitrary collections, like SparseArray or map that don't use string keys. I think this would be a valuable addition to LoganSquare. Have you considered adding this feature? What are you ideas on how this would work?
The text was updated successfully, but these errors were encountered: