This repository was archived by the owner on Jan 2, 2026. It is now read-only.
의약품 정보 API 호출 시 데이터 파싱은 어떻게 해야할까요? #10
Closed
HaechangLee
started this conversation in
1_Tech Talk
Replies: 3 comments 2 replies
-
|
저는 json 응답을 우선 String으로 받고, json 정보는 ObjectMapper로 객체화했습니다. 그래서 추가로 의존성을 추가했습니다. implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml' private JsonNode toJsonFromXml(String usageXmlText) throws JsonProcessingException {
XmlMapper xmlMapper = new XmlMapper();
JsonNode jsonNode = xmlMapper.readTree(usageXmlText)
.path("SECTION")
.path("ARTICLE");
return jsonNode;
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
@LEELISE 님이 MySQL에 json도 저장할 수 있다고 알려주셨어요. json으로 API요청을 해도, API응답 안에 xml을 일부 포함라고 있잖아요? 그러면 이 부분을 수정해서 통일된 json형태로 만들어, |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
데이터 파싱 작업은 완료되어 Closed 합니다. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
api 응답 시에 json 문서 내부에 xml 태그가 포함되어 있어, 자동으로 json 객체로 매핑하지 못하는 어려움이 있습니다.
어떤 방법을 사용해볼 수 있을까요?
Beta Was this translation helpful? Give feedback.
All reactions