-
Notifications
You must be signed in to change notification settings - Fork 45
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
Make automatic conversion between underscores and camelCase optional #62
Comments
Any thoughts on this @aryaxt ? |
hey @balazsgerlei sorry haven't had time to look into the repos for a while. Can you please explain the problem. I'm having a problem understanding what the problem is to have this logic automated. Thanks |
Hi, This issue really comes into play when I communicate with a server (via Json) which sends AND accepts Json with properties with underscore_cased properties. And with the current version of this lib I can only communicate with this server if I have two separate class of every model objects: one for each direction. This is because if I use camelCase in my class, the lib correctly parses received JSON into it, but it is converted to a JSON with camelCase properties when I try to send data back to the server. So to solve this problem, I suggest either this (what I detailed now in this issue) or a solution to the other issue that I created: That other issue suggests that automatic conversion to underscore_cased Json properties should be somehow achievable with library (so to be able to create a Json with undescore_cased properties from a class with camelCased properties). Ideally it would be the best solution to enable both and parse like I detailed in this issue, whole providing a way to choose between how properties are written to Json (either with the same casing or converted from camelCase to underscore_case). |
I had to force the 2.0 version on my app to make it work, waiting for a fix. |
You added automatic conversion from underscores to camelCase in 2.1 (#31), which is great but I think it would be better if it is optional.
I mean, if a property with underscore case found, parse the json node to that, and only try to parse to a camelCase one if a parameter with the exact same underscore case-d name not found.
The text was updated successfully, but these errors were encountered: