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
0 answers

how to add custom objectMapper for a specific spring rest controller

I have two controllers in my micro service both are POST and accepts Request body as JSON, one is working fine and another one's JSON input from some othet team and it is with root class name , so I need to write custom object mapper for this later…
nallskarthi
  • 281
  • 1
  • 8
  • 19
4
votes
2 answers

Mapping to Swift Object issue showing nil using Alamofire ObjectMapper

I m new to iOS and Swift development environment. I was trying to use Alamofire for pulling JSON and AlamofireObjectMapper for Mapping the retrieved JSON collections back to my Swift Object. The issue is I m able to fetch the JSON thru Alamofire…
user2695433
  • 2,013
  • 4
  • 25
  • 44
3
votes
0 answers

How to pretty format values on deserialize using jackson mapper

This is the sample code what I am doing to log the JSON object to the console and including error stack trace as part of field2. While I log to the console, that is not readable. Sample Code to understand issue. package goal.test; import…
Vivek Adhikari
  • 221
  • 2
  • 7
3
votes
0 answers

It Is possibile to map typescript object to another based on interface/or type

If i have an object in typescript const x = {a:1, b:2} And an interfacce interface MyInterface { a: number } It possibile to do something like (pseudocode) this const y = Mapper(x) console.log(y) // {a: 1} And the result should be…
dna
  • 2,097
  • 1
  • 11
  • 35
3
votes
1 answer

Jackson SNAKE_CASE How to generate underscore in field names before number

I have the next peace of code @Test fun `simple test`() { val objectMapper = ObjectMapper() .setSerializationInclusion(JsonInclude.Include.NON_NULL) …
user2105282
  • 724
  • 1
  • 12
  • 26
3
votes
1 answer

OAuth2Authentication object deserialization (RedisTokenStore)

I'm trying to rewrite some legacy code which used org.springframework.security.oauth2.provider.token.store.InMemoryTokenStore to store the access tokens. I'm currently trying to use the RedisTokenStore instead of the previously used…
3
votes
1 answer

DynamoDB Transactions : Write to different tables with dynamic names

I am trying to use Transactional writes for DynamoDB in Kotlin. Use case : I want to write two different objects to two different tables in the same transaction. For example : write AClass to Table 1 and write BClass to Table 2. This would've been…
Kancha
  • 409
  • 1
  • 3
  • 11
3
votes
2 answers

Reference to generic type 'Map' requires arguments in <...> - Swift

After updating the Xcode to 12.5 and updating all the pods , i start getting the above error in all files where mapping is happening Reference to generic type 'Map' requires arguments in <...> Insert '<<#Key: _MapKey#>, <#Value:…
Gaurav
  • 31
  • 1
  • 2
3
votes
2 answers

How to define reusable classes with dynamic types inside?

I have a class SuccessResponse that contains another custom class SuccessCustomerResponseBody, both of these classes are a POJO model for some XML structure. @JacksonXmlRootElement(localName = "response") public class SuccessResponse { private…
3
votes
2 answers

How to configure spring controller to use different objectMapper for the response (serialization)

I configured my own ObjectMapper for my SpringBoot application, Let say the object mapper is something like below (simplified): @Bean @Primary public ObjectMapper objectMapper() { return new…
rmrt
  • 63
  • 1
  • 4
3
votes
0 answers

How to solve "No such module 'ObjectMapper'" problem?

I have a problem with my swift project on XCode. I use Cocoapods for the frameworks. My project don't build. I have this error : No such module 'ObjectMapper'. I have tried pod install, pod update, pod deintegrate, clean build folder, delete…
3
votes
2 answers

Map JSON key-value to class in java

I need to map string JSON by key-value into the POJO class, but I'm not sure there is an easier way to convert this. My class: class Colors { private String name; private String color; public String getName() { return name; } …
3
votes
1 answer

What is the correct way to build JSON strings in Java so you don't get extra slash characters in result?

I'm using Spring MVC on the back end and Bootstrap/jQuery on the front end. My WebController's REST web service talks to a UserService, does stuff, and returns a Messages object with strings in it. The problem is, when the JSON gets returned to the…
user13156160
3
votes
1 answer

Spring object mapper covertValue method doesn't convert some fields

I have a Spring Boot 2 application which uses the ObjectMapper.convertValue method to convert from/to Entities and DTOs. I've been trying to understand why that method doesn't convert some of the fields, specifically, look at the following…
Shaunyl
  • 527
  • 2
  • 11
  • 24
3
votes
1 answer

Convert String with json to List

I am trying to convert JSON String (has to be the List) to Object List: [ { "paramName":"Content-Type", "paramValue":"text/xml; charset\u003d\"utf-8\"" } ] This is my Service.class: String jSONString = new…
janusz j
  • 321
  • 3
  • 17