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

Swift function generic parameter

So, I am using alamofire and object mapper library from github. In my function there is this code Alamofire.request(urlRequest).responseObject { (response: DataResponse) in } I do the response checking together with the status code also…
Alvin
  • 529
  • 1
  • 8
  • 19
3
votes
0 answers

Indentation in ObjectMapper not taken in account

If I use a YAMLFactory instead of default one (JSON) for ObjectMapper and configure a custom indentation, the indentation is not taken into account If I don't use YAML output, it works for the JSON output. Any idea ? DefaultPrettyPrinter.Indenter…
Mike Marquet
  • 124
  • 1
  • 7
3
votes
2 answers

return array of object with Alamofire

In my app I am using AlamofireObjectMapper. I want to make a method that returns an array of objects. With the help of Alamofire I made a GET request, which gives the response as responseArray. With using void function array listOfType always has…
3
votes
1 answer

Can not use realm with object mapper swift 3.0

I'm using Realm with Object Mapper for JSON Parsing. When I create a model class that Use both Object Mapper and Realm than I get compilation error error:must call a designated initializer of the superclass 'QuestionSet' import ObjectMapper import…
Kirit Vaghela
  • 12,572
  • 4
  • 76
  • 80
3
votes
1 answer

How to skip using @JsonCreator for Enums during deserialization of Json to Java Object?

An Enum Class, ColorName is generated using jsonschema2pojo from ColorName json file.So by default the Enum class has by default fromValue method annotated with @JsonCreator. @JsonCreator public static ColorName fromValue(String value) { …
3
votes
0 answers

how to fix Memory leak array on AlamofireObjectMapper

How can I solve the leak that happened in the sample code below, as seen in this image: import UIKit import Alamofire import AlamofireObjectMapper class ViewController: UIViewController { @IBAction func action(_ sender: Any) { load {…
wiislhbr
  • 31
  • 2
3
votes
1 answer

com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of TestAcceptanceCriteria out of START_ARRAY token

Given the following JSON file: [ {"name":"test_12345_54321", "acceptanceCriteria": [ { "given":"I am a developer", "and":"I have some test case to…
3
votes
2 answers

Swift 3.0 with Alamofire or Objectmapper "no such module Alamofire"

I am creating an application and I need to import "Alamofire" and "ObjectMapper" to call a service API REST. The problem is that I can not import any of the two pods in any way. To simplify the program I have created a project with only one…
3
votes
3 answers

ObjectMapper readValue

I load a ressource file json with the text format { "sources": [{ "prop1": "1", "prop2": "2" }, { "prop1": "1", "prop2": "2" }, ], "redirection": [{ …
lg0173
  • 208
  • 2
  • 8
  • 20
3
votes
1 answer

Swift Realm Object and Mappable

I'm using "Realm" and "ObjectMapper" in swift "Realm" does not support inheritance, so I have to make model like this: class Model1 : Object, Mappable class Model2 : Object, Mappable And I wanted to make a function that find local data with model…
JoonSoo Park
  • 43
  • 12
3
votes
1 answer

how to filter data from object mapper class

i want to implement search functionality in my app but i get data from services. i have an array like this in object mapper class Country : Mappable { var countryName:String = "" var countryID:Int = 0 var countryImage:String = "" var…
3
votes
1 answer

Issue with JSON to JAXB conversion using Jackson's ObjectMapper

I am working on a JAX-RS project. I am facing an issue with JSON to JAXB deserialization using Jackson's ObjectMapper. The technologies/frameworks used are - Jackson (FasterXML) 2.8.5 JAXB 2.2 The issue is with all IDREF fields while deserialising…
Frank
  • 134
  • 7
3
votes
0 answers

How do you map immutable nested objects with ObjectMapper?

I'm testing the immutable mapping in ObjectMapper (for Swift) and I can't get any immutable objects to map. For example, if I have let foo: Foo then later I have: public init(map: Map) throws { foo = try map.value("some_foo") } I get nothing in…
Jason Leach
  • 3,889
  • 7
  • 37
  • 54
3
votes
2 answers

Cassandra - unable to parse list of Tuple with Java driver

I am trying to access Tuple data structure I have stored in Cassandra with Mapper. But, I am unable to. I haven't found any example online. This is the table and data I have created. cqlsh:test> CREATE TABLE test.test_nested (id varchar PRIMARY KEY,…
spiralarchitect
  • 880
  • 7
  • 19
3
votes
4 answers

RealmSwift + ObjectMapper managing String Array (tags)

What I need to represent in RealmSwift is the following JSON scheme: { "id": 1234, "title": "some value", "tags": [ "red", "blue", "green" ] } Its a basic string array that I'm stumbling on. I'm guessing in Realm I need to represent…
darren
  • 579
  • 8
  • 23