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

Response class type in Alamofire request

I am an android developer new to swift 3 programming, I am using Alamofire for making api calls and to avoid tedious json paring I am using AlamofireObjectMapper library. I have a ApiController which has a function to make api calls below is the…
Syn3sthete
  • 4,151
  • 3
  • 23
  • 41
2
votes
2 answers

ObjectMapper toJson empty

I'm trying to deserialize an object into a JSON dictionary with ObjectMapper but the deserializing functions always return empty objects. class TimeEntryContainer: Mappable { //MARK: Properties var entry: TimeEntryObject =…
Karim Kouznetsov
  • 513
  • 1
  • 3
  • 13
2
votes
1 answer

How correctly parse SES bounced JSON SNS Notification in Java

I am receiving JSON from SNS topic, which I believe is not correct { "Type":"Notification", "MessageId":"message-id-is-this", "TopicArn":"bouncer.topic.name.here", …
PHP Avenger
  • 1,744
  • 6
  • 37
  • 66
2
votes
1 answer

Object Mapper making my values to optionals

struct User: Mappable { init?(map: Map) { } mutating func mapping(map: Map) { token <- map["token"] email <- map["email"] } var token : String! var email : String! } I'm declaring my strings as conditionally wrapped so that…
siva krishna
  • 1,149
  • 2
  • 15
  • 23
2
votes
1 answer

Swift ObjectMapper: Map array of objects that inherit from base object

I have a base parent object like this: class A: Mappable { var x: String! ... } And two children of it: class Child1: A { var y: Int! ... } class Child2: A { var z: String? } All this is good and dandy, but what happens when I…
la_f0ka
  • 1,773
  • 3
  • 23
  • 44
2
votes
3 answers

How to convert List to List Objects using object mapper?

I have a method like this: public List getAllCustomers() { Iterable customer = customerRepository.findAll(); ObjectMapper mapper = new ObjectMapper(); return (List) mapper.convertValue(customer,…
2
votes
1 answer

How do I create tell Jackson ObjectMapper to create a generic type?

This is a playful exercise for me to play with Kafka and Scala. My goal is to create a simple message type to send over kafka topic. Here's my attempt at the generic/re-usable serializer that takes a type parameter [A]. import java.util.{Map =>…
dlite922
  • 1,924
  • 3
  • 24
  • 60
2
votes
2 answers

How to convert String to list in java8 using ObjectMapper?

I have a JSON String called primarySkillStr : [ { "id": 3, "roleIds": [ 2 ], "rating": 2 } ] I try to map it to an object as follows: primarySkillList = mapper.readValue(primarySkillStr, new…
Supriya C S
  • 135
  • 3
  • 14
2
votes
1 answer

ObjectMapper Unresolved identifier 'Mapper'

My taskModel class file import Foundation import ObjectMapper // Mappeable source code public protocol Mappable { init?(_ map: Map) mutating func mapping(map: Map) } // Conform to the Mappable protocol class taskModel: Mappable { var…
utkal patel
  • 1,321
  • 1
  • 15
  • 24
2
votes
3 answers

Weird JSON mapping issue with Set - missing an element

Here is a simple Java code to test my issue: ObjectMapper mapper = new ObjectMapper(); String s = "[\n" + " {\n" + " \"id\": \"\",\n" + " \"name\": \"fsgh\",\n" + " \"email\":…
grekier
  • 2,322
  • 1
  • 16
  • 23
2
votes
2 answers

Object mapper vs Object wrapper

I would appreciate a little help here... Lets say that in an application we have a Data Layer and a Business Logic Layer. In the DAL we have the following entity: public class Customer { public string Name {get; set;} public…
Gabriel Lopez
  • 159
  • 3
  • 12
2
votes
2 answers

Jackson JSON Java nested object and arrays

I have an example nested json object like below : { "payload": { "id": "1", "apiResp": { "apiRespDetails": { "report": { "reportId": "reportid1", "reportDetails": [ { "code": "1", "rating": "good" …
NewQueries
  • 4,841
  • 11
  • 33
  • 39
2
votes
1 answer

xcode8 Alamofire 4 update error "use of undeclared type Response"

after updating to Xcode8 and Alamofire4 I am getting the error 'use of undeclared type Response' on the code "Response<[T]", (which uses ObjectMapper and realm) class FetchData { static func get (_ type: T.Type, success:@escaping () ->…
Dimitri T
  • 921
  • 1
  • 13
  • 27
2
votes
1 answer

Jackson ObjectMapper parsing of HashMap returns all fields = NULL

I am attempting to parse HashMap data into POJO using Object parsedMessage = objectMapper.convertValue(receivedMessage, destinationClass); where receivedMessage is a HashMap (earlier parsed from JSON) and containing fields of various types -…
onkami
  • 8,791
  • 17
  • 90
  • 176
2
votes
0 answers

Parsing relaxed JSON without quotes Java

This source Google Finance option Chain Data returns the relaxed JSON, I wasn't able to Parse this JSON through PDI (Pentaho Data Integratio) (originally required) So thought of Parsing it in Java Code. I tried using ObjectMapper and its Feature to…
ankit arora
  • 89
  • 15