dgs-examples-java icon indicating copy to clipboard operation
dgs-examples-java copied to clipboard

serializedRequest by ObjectMapper

Open littlelouishu opened this issue 3 years ago • 0 comments

WebClientGraphQLClient.class @Suppress("BlockingMethodInNonBlockingContext") val serializedRequest = GraphQLClients.objectMapper.writeValueAsString( Request( query, variables, operationName ) )

I noticed some strange behavior I think in the the code above.

if the LF (\n) in json value, the result of serializedRequest is \n. if the escaped LF (\n) in json value, the result of serializedRequest is \\n.

I expect result of serializedRequest is \n. (Since the server side can't parse the json which \n in it well, \n is OK.) How can I do this? Can I customize the ObjectMapper above?

littlelouishu avatar Feb 01 '23 02:02 littlelouishu