JSONObject transforms to nameValuePair
See original GitHub issueExample:
class Example {
@SerializedName("exampleField")
public JSONObject exampleField = new JSONObject("{\"name\":\"Nick\"}");
}
Log.e(TAG,gson.toJson(new Example()))
result:
"exampleField": {
"nameValuePairs": {
"name": "Nick"
}
}
expected Result:
"exampleField": {
"name": "Nick"
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
android - How can I delete the nameValuePairs key from the ...
Solution: Pass the actual JAVA object to @Body annotation, not it's corresponding JSONObject. GSON will take care of converting it to JSON representation....
Read more >Question: How can I transform the properties of a JSON object ...
I have a situation where I need to iterate through the properties of a JSON object and transform them to key/value pairs that...
Read more >org.apache.http.client.methods.HttpPost.setEntity java code ...
setEntity(new UrlEncodedFormEntity(nameValuePairs)); // Execute HTTP Post Request ... Build the JSON object to pass parameters JSONObject jsonObj = new ...
Read more >Java Code Examples of org.apache.http.message ...
This page provides Java code examples for org.apache.http.message.BasicNameValuePair. The examples are extracted from open source Java projects from GitHub.
Read more >JSONObject
A JSONObject constructor can be used to convert an external form JSON text into an ... Converts a string to a number using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use
com.google.gson.JsonObject
notorg.json.JSONObject
.GsonBuilder registerTypeAdapter