-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
JObject roundtrip issue #39
Comments
Hey Oliver, Thanks for taking the time to report this. I appreciate it. I think what's happening here is when you specify If you want to pull this
Let me know if this helps. PS. I'm going on off-grid tomorrow morning. So I won't be back for a couple of weeks. Also, I won't be around the Internet very much during my time off. |
It's good that you have that documented, but it doesn't help with my use-case. RethinkDB is a JSON store. All I'm doing is providing a thin HTTP wrapper around it. PUT saves json GET retrieves it back. As it stands I haven't found a good way to achieve non-destructive round-trip. Particularly when DateTimes are involved. I think the driver should attempt and interpret the datums as native types if possible. If it comes accross |
Looks like I'll need to to a post-processing pass on the JObjects. I can't have POCOs, unfortunately. The problem stems from impedance mismatch between JSON and native REQL representation. JSON does not have advanced types like DateTime. What happens here is you get value like On the way back ReqlDriver makes no interpretation I'm wondering what the solution is here? Should Reql Driver have a mode where it interprets |
Hi @oliverjanik, So I've been sort of avoiding this particular issue because of the complexities involved. But I guess it's time to discuss the music. 🎹 😸
In particular, I need some context, from what perspective?
In both cases, Now, as you've described, the problem arises when you have requested And here's where it gets tricky. Since So far, the only solutions I can really think of are: Solution A Solution B So I could be completely wrong since it's so very late here... but I think this is fundamentally what is happening here and I don't think there's an easy answer for this. |
Sorry, I wasn't clear enough. The flow of data is like this:
In I pass this JObject without any modifications to the On the way back I have this:
I grab my object from the Then I return this JObject as response from my controller. Result: The net result is that from |
I don't think the driver should treat I do believe you need a 2 stage parser. If I ask for |
Unfortunately, after reviewing some Newtonsoft source it looks like we would need a second stage parser specifically for The only reasonable alternative it seems is to bring back our JSON Path converter. Use JSON Path to iterate over the JObject and pluck out all the I'll need a few days to deal with this since this is a major breaking change and would mean we'd need to support |
Also, @oliverjanik , after exploring your specific issue more from
You can configure Newtonsoft to parse JSON date / times as
|
Thanks for the If I set it to |
…ow, by default, get passed though pseudo type conversion before being passed back to the user.
Fixes #39. Breaking Change: JObject and JArray (JToken derivatives) now, by default, get passed through pseudo type conversion before being passed back to the user.
Hi @oliverjanik , https://www.nuget.org/packages/RethinkDb.Driver/2.3.1-beta-2 -Brian |
Thanks heaps, you're a legend. |
@bchavez I've just upgraded to 2.3.3 stable and I still see this:
Is there anything I need to configure? |
Alright I had The abstraction leaks. :-) |
As promised here's a test that fails JObject roundtrip failing test. Just drop it into the
GitHubIssues.cs
There's the output of
check.Dump()
:The text was updated successfully, but these errors were encountered: