티스토리 뷰

공부

[kotlin] merge json

승가비 2022. 6. 20. 00:15
728x90
fun merged(a: Map<String, Any>, b: Any): Map<String, Any> {
    return objectMapper
        .readerForUpdating(a)
        .readValue(objectMapper.writeValueAsString(b))
}

https://stackoverflow.com/questions/9895041/merging-two-json-documents-using-jackson

 

Merging Two JSON Documents Using Jackson

Is it possible to merge two JSON documents with the Jackson JSON library? I am basically using the Jackson mapper with simple Java Maps. I've tried to search in Google and Jackson's documentation ...

stackoverflow.com

 

728x90
댓글