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
0 answers

Low level JSON manipulation library for Java

I am looking for a 3rd party library which can manipulate entities stored as JSONs. This is intended to be used in the (cucumber) test framework to specifically tailor predefined JSON requests to a specific situation. For example let`s consider the…
2
votes
1 answer

How to capture latency metrics for serialization and deserialization by ObjectMapper?

I have a basic ObjectMapper configured with a custom serializer and deserializer for a property in my Object. I would like to capture the latency for serialization and deserialization of my entire Object using a Micrometer Timer meter. I can add a…
frpet
  • 155
  • 1
  • 9
2
votes
0 answers

How to convert a json string to java map

I've a json string which must be converted as a Java map of Long and Object. When I tried with Jackson ObjectMapper it creates LinkedHashMap instances instead of Object Json String "2": { "firstName": "test", "lastName": "test", …
Jijo
  • 107
  • 1
  • 1
  • 10
2
votes
1 answer

Json to Java Object - Failed due to identical fields

I am trying to convert a json to a java object. Since there are identical fields in the json, it throws an error like this. com.fasterxml.jackson.databind.JsonMappingException: Conflicting setter definitions for property "amount":…
Supun Amarasinghe
  • 1,443
  • 3
  • 12
  • 24
2
votes
3 answers

Map a JSON field (to a value) based on another field (which is a key) using Jackson

{ "key1": { "parameter1": "String1", "parameter2": "String2" }, "key2": { "parameter1": "String3", "parameter2": "String4" }, "key3": { "parameter1": "String5", "parameter2": "String6" } } I have the above JSON…
2
votes
1 answer

Is using NSArray in Codable possible? (transforming "Object Mapper" to "Codable")

I am trying to transform "Object Mapper" to "Codable". My response which comes from service includes NSArray which includes custom objects. I need to use NSArray and NSDictionary in Codable Class. But, i failed.I tried to use third party library…
Okan
  • 410
  • 4
  • 10
2
votes
1 answer

Disable Base64 encoding while Serializing on Jackson ObjectMapper

I am using Jackson 2.2.3. When I serialize an object to JSON, all the byte[] properties are encoded to base64 in generated json. How do I disable that? Here is my code. DataHolder.java @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "",…
Kishor Prakash
  • 8,011
  • 12
  • 61
  • 92
2
votes
1 answer

How to map Nested Array of Objects using Swift Object Mapper?

I am trying to map an array of objects using Object Mapper I have this code so far, and my mapping is not successful do { if let data = data, let sectorData = Mapper().mapArrayOfArrays(JSONObject: try…
2
votes
3 answers

Deserialise enum field with Jackson

I have a simple enum Days public enum Days { @JsonProperty("Monday") MONDAY("Monday"), @JsonProperty("Tuesday") TUESDAY("Tuesday"); private String day; Days(String day) { this.day = day; } @JsonValue …
Yanick Nedderhoff
  • 1,174
  • 3
  • 18
  • 35
2
votes
1 answer

Deserialize JSON with Jackson and @JsonCreator

I receive JSON documents from a third party tool, which is under development, i.e. the JSON is extended frequently. I would like to stick with the simplest deserialization mechanism in order to avoid increased maintenance that comes with custom…
Uwe
  • 85
  • 1
  • 5
2
votes
1 answer

Jackson mixin: How to Ignore or Rename fields from class as tree

I'm trying to do deep filtering (rename / ignore fields) from class that is represented as a tree. With Jackson Mixin I can rename or ignore fields from root level. What I want to achieve, is how to do filtering (rename / ignore) on multy levels?…
Ster-BigData
  • 89
  • 2
  • 11
2
votes
3 answers

Swift ObjectMapper: How to parse array inside of an array

This is my JSON response: [ [ { "id": 22, "request_id": "rqst5c12fc9e856ae1.06631647", "business_name": "Code Viable", "business_email": "code@viable.com", "title": "Apache…
Brendon Cheung
  • 995
  • 9
  • 29
2
votes
1 answer

BaseObject which can have NSObject,Mappable and Object swift

i Have a BaseRequestObject of type NSObject,Mappable which is inherit by a object called User. I need to save this User object inside realmDB. class BaseRequestBody: NSObject,Mappable { override init() { } required init?(map: Map) { } func…
Abhijit Hadkar
  • 210
  • 2
  • 11
2
votes
2 answers

Optimizing fasterxml ObjectMapper for list of Objects

I want to optimizes ObjectMapper for a list. The requirement is that I need to add a delimiter after each element of the list. My current code looks like : StringBuilder strBuilder = new StringBuilder(); for (Event event : segregatedList) { …
Suraj Menon
  • 1,486
  • 3
  • 28
  • 50
2
votes
2 answers

java jackson keep type information after serialize if variable of type Object

ClassA public class ClassA { private String id; private Object rawData; } ClassB public class ClassB { private String name; } ClassC public class ClassC { String address; } Main Class public class MainExample { public static void…
Pratap A.K
  • 4,337
  • 11
  • 42
  • 79