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

Jackson Java Object mapping fails reporting non-existent 'known properties'

I have a JSON object that is being mapped to a Java Object. The JSON contains nested data which the Java Object handles. My case is large so I will use a cut down version as an example of what I am attempting. My JSON data looks like…
Shiri
  • 1,972
  • 7
  • 24
  • 46
2
votes
1 answer

Reusing ObjectMapper model for multiple mapping

Hi i am using ObjectMapper for my Json mapping and i have a model class named People which has one property personName and i am doing the mapping like this class People : Mappable,BaseMappable{ var personName : String? required…
nishith Singh
  • 2,968
  • 1
  • 15
  • 25
2
votes
1 answer

Issues calling super method in ObjectMapper

trying to convert ObjectMapper syntax to Swift 3.0: class CustomJsonResponse: Mappable { var status: String? var response: String? var errorCode: CustomErrorCode? init() { } required init?(map: Map) { } func…
KexAri
  • 3,867
  • 6
  • 40
  • 80
2
votes
2 answers

How to Unit Test JsonMarshaller with pretty print enabled?

I have a method called JsonMarshall(T t) that takes an object and converts it into Json String. Inside this method I'm using the Objectmapper to accomplish this task: mapper.writerWithDefaultPrettyPrinter().writeValueAsString(t) Now, lets say I…
Qad
  • 51
  • 3
  • 7
2
votes
1 answer

Jersey and Object Mapper

I am a bit confused as to when I need to use an object mapper. I thought it should be used for mapping a result set from a DB query into objects so I created an object mapper like this: public class PersonMapper implements ResultSetMapper { …
CodeMonkey
  • 11,196
  • 30
  • 112
  • 203
2
votes
1 answer

Object Mapper - parsing array of [AnyObject]

I have response JSON of multitype objects from API. It has type property inside. Now I'm trying to apply some kind of automated mapping basing on type property, but I can't make it work in any means. private let modelClassMap = [ "first_type":…
yershuachu
  • 778
  • 8
  • 19
2
votes
1 answer

Mapping a trimmed response using ObjectMapper Or wrapping the response obtained

Details --- One of my POJO SomeResponseObject for an api response has attribute @JsonProperty("s_summary") private Map summary which further has few more attributes. These are summed in json as follows : { …
Naman
  • 27,789
  • 26
  • 218
  • 353
2
votes
1 answer

Too Many objects in single instance of ObjectMapper SerializerCache causing memory leak

We are running a spring boot based service with which, we are having GC issues on running perf tests. When we looked at the heap dump on Eclipse plugin "Memory Analysis Toolkit" (MAT), we found below: One instance of…
Shailesh
  • 75
  • 1
  • 9
2
votes
1 answer

How to persist an array using Realm Swift and ObjectMapper?

I get an error when I try to save an array that comes from a JSON string. I've tried to use RLMArray with no success. The error I receive is: 'RLMException', reason: 'Property 'page' is of type 'RLMArray<(null)>' which is not a supported RLMArray…
Marckaraujo
  • 7,422
  • 11
  • 59
  • 97
2
votes
1 answer

Swift: How to check if an object of a generics type is an array of a subtype of a type

I am working on a Swift project involving Alamofire, ObjectMapper and RealmSwift and ran into a situation where I have to check if an object of a generics type is an array of Realm's Objects. My question is: How to check if an object of a generics…
Thanh Pham
  • 2,021
  • 21
  • 30
2
votes
2 answers

How to map custom Enum/RawRepresentable to dictionary with ObjectMapper?

using the following simplified structure: class Property: Mappable { var path: String? override func mapping(map: Map) { path <- map["path"] } } class Specification { enum Name: String { case Small = "SMALL" …
mvoelkl
  • 143
  • 1
  • 10
2
votes
2 answers

Realm + Swift update object with JSON string

I am using the alamofire to get response JSON from server, then using ObjectMapper to map string to Realm object. The realm object is: class SolutionVideo: Object, Mappable { dynamic var svID = 0 dynamic var solutionTitle = "" dynamic var…
Janice Zhan
  • 571
  • 1
  • 5
  • 18
2
votes
2 answers

JSON response data into swift objects [ObjectMapper]

Can you guys help me create swift objects of using ObjectMapper of following JSON data? [{ "location": "Toronto, Canada", "three_day_forecast": [ { "conditions": "Partly cloudy", "day" : "Monday", …
Parion
  • 428
  • 9
  • 18
2
votes
2 answers

How can i access value of other Mappble class object.(Alamofire Object Mapper)

in my app i am first time using AlamofireObjectMapper. So i am mapping api response data in one class and then i want to use that data. So here is my code that how i map object extension OrderListViewController { func get_order_list() { …
Jack.Right
  • 974
  • 3
  • 14
  • 30
2
votes
1 answer

Swift ObjectMapper type inference

Dear Stackoverflowers, I have a hindrance regarding using ObjectMapper, so lets get straight to the point. I'm saving models as a temporary record in a SQLite table, in JSON form. Each model has a Type field that uniquely identifies to which Model…
D6mi
  • 611
  • 7
  • 16