class FieldExtractor {

    public List<String> extractList(HttpServletRequest request, String fieldName, MessageError messageError) {
        List<String> fieldList = new ArrayList<>();
        try {
            fieldList.addAll(xs2aObjectMapper.toJsonGetValuesForField(request.getInputStream(), fieldName));
        } catch (IOException e) {
            errorBuildingService.enrichMessageError(messageError, TppMessageInformation.of(FORMAT_ERROR_DESERIALIZATION_FAIL));
        }
        return fieldList;
    }

}