Questions tagged [objectmapper]

ObjectMapper is a library for simple JSON object mapping in Swift.

ObjectMapper is a library for simple JSON object mapping in Swift.

1145 questions
-2
votes
2 answers

How to map this json to a custom class in java

Let's assume I have the following json [ { "00080005":{ "vr":"CS", "Value":[ "ISO_IR 100" ] }, "00080054":{ "vr":"AE", "Value":[ …
zyydoosh
  • 387
  • 2
  • 14
-2
votes
1 answer

Cannot deserialize value of type `Covid` from Array value (token `JsonToken.START_ARRAY`)

Main method public static void apiRequest(String country){ HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://covid-19-data.p.rapidapi.com/report/country/name?date=2020-04-01&name="+country)) …
Goggi
  • 32
  • 8
-2
votes
2 answers

GSON serialization issue in Java for BigDecimal

Need to convert JSON string into Java object. { "amount":1.0000 } I am trying to covert string using GSON.fromjson(response, Amount.class); This value was changed to 1.0 in object. Please help to resolve this. I tried the same thing in…
vigneshwaran m
  • 351
  • 2
  • 12
-2
votes
1 answer

How to convert a map to escaped string in json form in kotlin?

I have a mutableMap, val invoiceAdditionalAttribute = mutableMapOf() invoiceAdditionalAttribute.put("clinetId",12345) invoiceAdditionalAttribute.put("clientName", "digital") invoiceAdditionalAttribute.put("payload", "xyz") I want to…
Akash Patel
  • 189
  • 1
  • 5
  • 13
-2
votes
1 answer

ObjectMapper using com.jsoniter library

I have a Map map that was deserialized from a simple JSON string {"field1":"val1", "field2":"val2", "isReal":true}. I am trying to construct a Java object MyObject with the above fields. I can do it using…
QuirkyBit
  • 654
  • 7
  • 20
-2
votes
1 answer

Parse Json into POJO using Jackson

I have the following json { "root": { "status": "UP", "connection1": { "status": "UP" }, "connection2": { "status": "UP" } } } Also i have the following POJO classes i want to…
-2
votes
1 answer

Jackson serialize POJO to JS Object

class Foo { String name = "Bar"; } Serialising the above object using ObjectMapper().convertValue(foo, JsonNode::class) will return JSON object as: { "name": "Bar" } my desired result however is: { name: "Bar" } I have tried a custom…
Sterling Duchess
  • 1,970
  • 16
  • 51
  • 91
-2
votes
2 answers

Can I declare a variable with square brackets?

I am writing a POST API where I need to form a payload as, { "questions":{ "preferredAnswer":{ answer[0]:"my first answer", answer[1]:"second answer" } } This needs to be mapped as a java object. My questions is, Is there a way I can…
Gayathri
  • 15
  • 7
-2
votes
2 answers

How to filter an array of generic type in iOS

I have a function to which I am sending an array of objects. What I want to do is to filter this array of objects using their values, since the objects may not have common properties like name, age, etc. func searchVC(_ searchCriteria: String, _…
iCodes
  • 1,382
  • 3
  • 21
  • 47
-2
votes
1 answer

Swift code generation to Realm classes

Does anyone know a tool that could convert plain Swift class to a Realm class that inherits from Object? Ideally it could also conform to Mappable from ObjectMapper.
jonaszmclaren
  • 2,459
  • 20
  • 30
-2
votes
1 answer

Using Jackon ObjectMapper to read a String created from a response with invalid json

Problem using Jackon ObjectMapper to read a String created from a invalid JSON response Here is the relevant snippet of the code: Response response = request.get(); String responseAsString = response.readEntity(String.class); ObjectMapper mapper…
SuperCow
  • 1,523
  • 7
  • 20
  • 32
-2
votes
1 answer

ObjectMapper can't map the variables of inner class

ObjectMapper mapper = new ObjectMapper(); try { attractionMainResponse = mapper.readValue(response,AttractionMainResponse.class); } catch(IOException io) { showToast("Something went wrong"); …
-2
votes
1 answer

HTTP: Receiving an Array of Objects from server

I need to connect my backend to my front. My front is Angular2+TS. So the problem is in the service and the component. I can't figure out the syntax. Service: getCases(){ return this.http.get('some URL') --- what code here? --- } At the moment…
AT82
  • 71,416
  • 24
  • 140
  • 167
-3
votes
1 answer

How can I read json file in java, update the values and store it back to same file?

I have a json file as below and now I need to update the pincode value Everytime before using and use the updated json file for processing,how can I achieve the same using Java? { "Name":"Ramesh", "City":"Bangalore", "Address": { …
umesh
  • 1
  • 3
-3
votes
2 answers

Return object as Json in java

We would like to return Object class as JSON string public static String genJson(Response r, Auth auth) { Auth p = new Auth(); ObjectMapper mapper = new ObjectMapper(); String transactionResult =…
Hoo
  • 1,806
  • 7
  • 33
  • 66
1 2 3
76
77