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
3
votes
1 answer

alamofireobjectmapper requestObject cant make correct request and mapping

Hi I'm having an issue with parsing. When I try to parse this JSON in my tableviewcell and can't get the values ​​that I need. My request: let videos = NewestVideos() let URL = "https://api.vid.me/channel/1/new" override func…
DmitrievichR
  • 119
  • 1
  • 11
3
votes
2 answers

Jackson custom serializer by field name?

I have a POJO to be serialized which has field of type Object named representation and I have a custom serializer written for it. POJO: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "user", propOrder = { //...... }) public class User…
Siddharth Trikha
  • 2,648
  • 8
  • 57
  • 101
3
votes
1 answer

Serialize nested object json jackson

I am using Jackson json library to convert my POJOs to json: public class A { public String name; public B b; } public class B { public Object representation; public String bar; } I want to serialize…
Siddharth Trikha
  • 2,648
  • 8
  • 57
  • 101
3
votes
2 answers

Parsing HTTP request payload with Jackson

I want the payload of my HTTP request to be converted into a JSON string and I am using Jackson library for it. First I convert it to a Map and then to a JSON string. try { ObjectMapper mapper = new ObjectMapper(); JsonParser jsonParser =…
Siddharth Trikha
  • 2,648
  • 8
  • 57
  • 101
3
votes
0 answers

DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES is not getting set to false in spring boot 1.3

I have configured @Bean for Jackson2ObjectMapperBuilder where I am setting the DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES property set to false, in order to allow deserialization of JSON objects with unmapped properties. As- @Bean public…
3
votes
1 answer

How to use inheritance with Swift and ObjectMapper?

I'm new to Swift and I have to serialize an object structure into a JSON string in my iOS( iOS >= 8) project. So I decided to use the ObjectMapper library (I integrated it with Cocoapod). But my problem is that the structure is the…
Nicolas Massart
  • 530
  • 9
  • 21
3
votes
1 answer

Program crash while using ObjectMapper with Realm in Swift

If I use ObjectMapper with normal swift class, I am able to get JSON object created but when I use it with Realm class model, program crash. I tried to play around it ( check whether object exist, then using overriding primaryKey method but didn't…
Naren
  • 1,504
  • 16
  • 19
3
votes
2 answers

Manually mapping an object using AlamoFireObjectMapper

I'm trying to write some unit tests and need a way to make a dummy version of an object that is mappable. For example: class MyClassJsonResponse: Mappable { var status: String? var response: String? var errorCode: SAErrorCode? …
Kex
  • 8,023
  • 9
  • 56
  • 129
3
votes
2 answers

variable reset to default in realm

In RealmSwift, I have an Object, Message. I am using ObjectMapper to map its properties from a REST service. I also want a local property, dynamic var read:Bool = false to keep track if a user has read a message. try! realm.write({ m.read =…
superandrew
  • 1,741
  • 19
  • 35
3
votes
1 answer

Spring Integration Java DSL — How to configure the JSON transformer to take Spring boot's global settings?

I am using an integration flow to call a RESTful web service as follows: @Bean IntegrationFlow flow() throws Exception { return IntegrationFlows.from("inputChannel") .handle(Http.outboundGateway("http://provider1.com/...") …
user3329862
  • 83
  • 2
  • 6
3
votes
1 answer

JacksonConverter and ObjectMapper for nested objects

I am using Retrofit and JacksonConverter to fetch JSON data from an API. The JSON response is like this:- [ { "id": 163, "name": "Some name", "nested": { "id": 5, "name": "Nested Name", } } ] But in my class I only…
Abhinav Nair
  • 958
  • 1
  • 8
  • 29
3
votes
1 answer

Errors: Expected declaration, Use of undeclared type 'Object', Use of undeclared type 'JSON'

Started integrating the ObjectMapper in my iOS application to map the objects to entities. But getting errors Errors: Expected declaration, Use of undeclared type 'Object', Use of undeclared type 'JSON'
Harshavardhan
  • 1,266
  • 2
  • 14
  • 25
3
votes
1 answer

Working with <- in Swift

I was looking at ObjectMapper libary. And noticed the <- operator. How does this exactly work ? // Mappable func mapping(map: Map) { username <- map["username"] age <- map["age"] weight <- map["weight"] array …
Prakash Raman
  • 13,319
  • 27
  • 82
  • 132
3
votes
4 answers

how to parse following JSON using object mapper

This is the JSON [{ "start_hour": "08:00:00", "end_hour": "10:00:00", "call_duration": "30" }] I tried to parse as follows class DoctorAvailablityResponseData: Mappable { var startDateHour : String? var callDuration : Int? var…
Mandeep Kumar
  • 776
  • 4
  • 18
3
votes
2 answers

Using Alamofire and Objectmapper the integer value always zero

I am using Alamofire with ObjectMapper and my model class is like that class Category: Object, Mappable { dynamic var id: Int = 0 dynamic var name = "" dynamic var thumbnail = "" var children = List() override static func primaryKey()…
Ayman
  • 175
  • 1
  • 13