-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
JSON API v2 #682
Comments
How would the API handle this?
I can't change the Json input, so I was thinking that an Annotation-based Transformation, could play nice in this situation, there are plans on it? |
@Hazer you mean like serialized name? It's in the proposed documentation above
I'm also waiting for this feature, is there any ETA, @cmelchior? Thanks. |
@highwater don't think so, I didn't made it clear. I was thinking in that "badges" list, that would translate to List in Java. Realm can't save it. Serialized Name can help with it and I can't see ? But in any case, I am waiting for SerializedName also. |
@highwater Sorry no. Next on our list is being able to use custom constructors for RealmObjects which would make it possible to eg. use tools like GSON. @Hazer Currently Realm doesn't support lists of primitive types. There is a an issue for it here: #575 . Once that is implemented it should be trivial to add JSON support for it. |
@cmelchior Thanks for pointing out issue #575 . The JSON API Parser will be dropped in favor of the possibility of using external tools? Or its just higher priority to support external ones? |
@Hazer |
@cmelchior Do you have a timeline for the custom constructors for RealmObjects (to use GSON)? Thanks! |
It is next on my list, right after we finish up merging outstanding PR's. So baring anything unexpected I will begin working on it today or tomorrow. |
Hi! Are you guys planning to add a createOrReplaceFromJson? Right now we get a lot of duplicate objects just with the createFromJson and the populate method in RealmObjects is package protected. |
Awesome 👍 |
@cmelchior Is there any progress on storing dates with different formats in android? for instance, I am trying to store date format EEE, dd MMM yyyy hh:mm:ss Z and its crashing. |
@hareshsandeep Could we please ask you to create a new issue with more details so we can better help? Thanks! |
Is there any update on this? Is it hard to implement #1470 as one of the first steps? |
Ok, I'd be willing to work on this, but wanted to first discuss naming and similiar design choices. The following is on my checklist:
I'd also want to add similiar functionality to the realm-cocoa library, if you're open to that. My knowledge in Objective-C/Swift isn't as profound as in Java though, so I would probably need a few pointers here and there. So, in short, here's what I would propose for the API (all up for discussion though):
|
Regarding |
Hi @TR4Android Thank you very much for offering your help. We talked about this a bit internally and at his point in time we are not really comfortable going the route of export/import API's. We can definitely see the point of them, but we really would like to avoid being a complete JSON library on top of being and database, especially since libraries like GSON, Moshi and Jackson already does a pretty good job. So while we haven't agreed fully on the future yet, there is a fairly big chance we instead would want to autogenerate type adapters for the common GSON libraries and use an adapter approach like what is known from e.g. Retrofit. In that process our existing JSON API will most likely be fully deprecated.
I would however like to move that discussion to #1470 instead as that issue is more specific for this specific functionality. I will write up my thoughts on what is needed in #1470 |
Folding this into #3758 |
Design and implement a more complete solution for our JSON API.
Current design doc is here:
https://github.com/cmelchior/realm-java/blob/29ab93bf7aeaa5cd048cbf468a228046496ecb13/json_api.md
Other features:
Strict mode: We should probably consider adding something like STRICT mode to our JSON parser which could throw an exception when encountering JSON properties it didn't recognise. At least for debugging it could save a lot of time.
Json export It should also be possible to convert any RealmObjects to JSON.
The text was updated successfully, but these errors were encountered: