-
Notifications
You must be signed in to change notification settings - Fork 41
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
How send a complex object via the API ? #75
Comments
What have you tried so far? What were the results? |
Sorry, I didn"t get notified you answer me.... I get an error : "Unprocessable Entity". I deal with the code until the Object.toMap() return a JSON like file..... but still something wrong. What are the rules to extends Model with it own Object, especially when there is composition pattern. |
When I logged Obj.toMap().toString(), I get {wineColor=1, id=Bouche:Equilibre, wineType=1, oenoLevel=1, instruction={what=Pas d information, how=Pas d information, why=Pas d information}, tripTag=Bouche:Equilibre} When I update (replace = by : and adding ") this text to { and I put in the Loopback Explorer, this work with the API, but not from the Client |
@bajtos any news or comment to help ? |
The SDK uses JsonUtil to convert from Java objects to JSON representation. See this unit-test for an example what is the correct way of creating nested object structures. Try to enable ADB debug logs, the SDK is logging all request data via I am afraid I don't have much time to investigate this. It would help me a lot if you could create a standalone app (LoopBack server, Android client) that I could run on my machine to reproduce the problem. |
I would make it one flatten into string then using the string and pass it into the url. Using Gson to flatten the object and parse it into the url. |
How can I implement saving a complex object from Android to the Server.
The object is defined as object type on the server, and on Android is a Hashmap of subObjects, which are itself hashmaps.
The text was updated successfully, but these errors were encountered: