Код: Выделить всё
import org.ojai.Document;
public Object get(String documentId) {
final Document dto = getDocument(documentId);
return convert(dto);
}
…..
public Document getDocument(String documentId) {
return Json.newDocument(documentId);
}
……….
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.setSerializationInclusion(Include.NON_NULL);
objectMapper.configure(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS, true);
objectMapper.configure(JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN, true);
objectMapper.convertValue(document, CarDto.class);
Код: Выделить всё
org.ojai.exceptions.DecodingException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('#' (code 35)): Expected space separating root-level values
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 6]
at org.ojai.json.impl.JsonStreamDocumentReader.hasMoreTokens(JsonStreamDocumentReader.java:634) ~[ojai-3.0-mapr-1808.jar!/:3.0-mapr-1808]
Есть ли лучшее решение для переноса кода без использования библиотеки OJAI?>
Подробнее здесь: https://stackoverflow.com/questions/771 ... evel-value
Мобильная версия