티스토리 뷰

공부

[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

'공부' 카테고리의 다른 글

[java] org.apache.commons.lang3.CharEncoding.UTF_8  (0) 2022.06.20
[kotlin] avroUtils (/avsc)  (0) 2022.06.20
[kotlin] merge json  (0) 2022.06.20
[Shell]join string array  (0) 2022.06.20
[Kotlin] add list + list  (0) 2022.06.19
[JavaScript] const result = await Promise.all([].map(i => async))  (0) 2022.06.06
댓글
댓글쓰기 폼