org.springframework.http.converter.HttpMessageConversionException:
Type ошибка определения: [простой тип, класс
java.io.BufferedInputStream]; вложенным исключением является
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: не найден
сериализатор для класса java.io.BufferedInputStream и не обнаружено
свойств для создания BeanSerializer (чтобы избежать исключения,отключить SerializationFeature.FAIL_ON_EMPTY_BEANS) (через ссылочную
цепочку:
ru.fabit.visor.ui.web.http.model.response.complexes.mobilecomplex.DeviceSummaryResponse["route"]->org .springframework.core.io.InputStreamResource["inputStream"])
Метод Rest:
Код: Выделить всё
@GetMapping(DEVICE_ID_PATH)
public ResponseEntity getDeviceSummary(@PathVariable(name = "id") Long id) {
log.debug("REST request to get summary for complex with id = {}", id);
var deviceSummary = mobileComplexService.getSummary(id);
return ResponseEntity.ok().body(deviceSummaryMapper.toResponse(deviceSummary));
}
Код: Выделить всё
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DeviceSummaryResponse {
@ApiModelProperty(value = "Конфигурация устройства", required = true)
private ConfigResponse config;
@ApiModelProperty(value = "GPX файл с маршрутом устройства", required = true)
private Resource route;
}
Подробнее здесь: https://stackoverflow.com/questions/758 ... e-definiti