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
4
votes
3 answers

RestAssured does not respect ObjectMapper configuration in Quarkus

I've made a very simple adjustment to the ObjectMapper configuration in my Quarkus application, as described per the Quarkus guides: @Singleton public class ObjectMapperConfig implements ObjectMapperCustomizer { @Override public void…
romatthe
  • 1,447
  • 3
  • 17
  • 33
4
votes
1 answer

Converting GET response from restTemplate to Custom Class

So, I am playing with RestTemplate in a spring-boot REST API. I have a TEST spring-boot application which makes a restTemplate call to another application EMPLOYEE-TEST. For now I have Employee model class present in both applications but a…
Akki
  • 754
  • 7
  • 22
4
votes
0 answers

EXC_BAD_ACCESS in parent class init() with Xcode 10.2

I’ve been pulling my hair on a weird bug in Xcode 10.2. I’ve had this swift util method to decode JSON objects using ObjectMapper as I can’t call ObjectMapper from ObjectiveC: @objc static func mapModel(fromClass: AnyClass, jsonDict: [String : Any])…
Simon Reggiani
  • 550
  • 10
  • 18
4
votes
1 answer

self referencing relationship with spring data jpa

I am building an application with spring boot and have to setup a self-referencing relationship. In order to make the scenario simple and easy to understand, I have tried to work on a similar scenario with a department entity example. Following is…
4
votes
2 answers

ObjectMapper - How to send null value in JSON

According to third party API spec, I need to send null value in JSON using ObjectMapper if no value exists, Expected results : "optional": null If optional value exists, then send "optional": "value" I didn't find such option in Jackson – Working…
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
4
votes
1 answer

Generic network call with Alamofire and ObjectMapper

I am using Alamofire, and Alamofire Object Mapper to make network request and serialize it. We always get our response same shape with following example that includes result, isSuccessfull and message. { "Result": { "WaitingCount": 0, …
atalayasa
  • 3,310
  • 25
  • 42
4
votes
2 answers

Can I ignore MismatchedInputException within ObjectMapper?

I'm using the Jackson ObjectMapper class like so: objectMapper.treeToValue(jsonNode, MyClass.class) where jsonNode is an instance of JsonNode. When I call treeToValue(), I get a MismatchedInputException with the message Cannot deserialize instance…
user2121620
  • 678
  • 12
  • 28
4
votes
2 answers

MappingJackson2HttpMessageConverter instantiated multiple times during Spring 4 start-up overriding (null'ing) custom ObjectMapper settings

I am trying to configure my ObjectMapper to have a specific TimeZone instead of using the Default GMT. I followed the instructions from different places (see references below) trying to configure via code and by XML. After debugging I notice that…
Joe A
  • 300
  • 3
  • 9
4
votes
2 answers

Supply Long Object Pool to Jackson Object Mapper

I have a JSON that I convert into POJOs. The JSON is read from a GZIPInputStream gis. ObjectMapper mapper = new ObjectMapper(); TypeReference> typeRef = new TypeReference
Pranav Kapoor
  • 1,171
  • 3
  • 13
  • 32
4
votes
3 answers

How can YAML Mapper ignore certain fields in the yml file during deserialization?

I have a property.yml file in my project, as follows: propertyA : "valueA" propertyB: "valueB" propertyC: "valueC" I am using the following java code for deserialization from the above yml file: File configFile = new…
Arijit
  • 420
  • 7
  • 14
4
votes
2 answers

Using different jackson ObjectMappers for seperate RequestMapping

I have a single @RequestMapping that consumes a custom MIME type. The request uses an ObjectMapper bean defined in the @Configuration to enabled the JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER. This feature allows typically invalid…
Jags
  • 1,639
  • 1
  • 16
  • 30
4
votes
2 answers

Deserialize object reference in Jackson

I am trying to deserialize a object ref ($ref) using ObjectMapper. public class Foo { @JsonProperty("bar") private Bar bar; @JsonProperty("bar") public Bar getBar() { return bar; } @JsonProperty("bar") public…
atom
  • 157
  • 3
  • 10
4
votes
2 answers

camel case json to snake case json in scala/java

I have a JSON object where the keys are in camel case inside a string in scala, and I want to convert it to snake case json (where keys are in snake case) string. Is there a clean way to do it? I was looking at Jackson object mapper and finatra…
Abdul Rahman
  • 1,294
  • 22
  • 41
4
votes
2 answers

AlamofireObjectMapper in swift 3

I want to use AlamofireObjectMapper for the first time to parse a json response in swift. The response is: "success": true, "terms": "https:\/\/currencylayer.com\/terms", "privacy": "https:\/\/currencylayer.com\/privacy", "timestamp":…
user7168364
4
votes
1 answer

Configure objectmapper inside Custom serializer jackson?

I have a CustomSerializer for a particular field written. I call the custom serializer on an ObjectMapper with certain configurations like WRAP_ROOT_VALUE, PropertyNameStrategy, Inclusion.NON_NULL. Now inside my custom serializer I want all these…
Siddharth Trikha
  • 2,648
  • 8
  • 57
  • 101