Код: Выделить всё
@PostMapping(value = "createParnter", consumes = "multipart/form-data")
public ResponseEntity createPartner(
@ModelAttribute PartnerRequest partnerRequest
)
Код: Выделить всё
record Contacts(
String name,
String email,
) {}
public record PartnerRequest(
String name,
MultipartFile logo,
String link,
List contacts
){}
[img]https://i. sstatic.net/9Qto6E9K.png[/img]
Однако, если я попытаюсь отправить список контактов вместе, я получаю какую-то ошибку преобразования:
Код: Выделить всё
"Failed to convert value of type 'java.lang.String' to required type 'java.util.List'; Cannot convert value of type 'java.lang.String' to required type 'com.example.dto.Contacts' for property 'contacts[0]': no matching editors or conversion strategy found"Код: Выделить всё
[{"name": "testName", "email": "testEmail}]
Подробнее здесь: https://stackoverflow.com/questions/791 ... rt-request