Here is my DTO
@Data
public class PermissionAddDto {
@NotBlank
private final String permName;
}
When I post this request
{
"perm_name": "account_write"
}
It return an error :
JSON parse error: Cannot construct instance of
com.hung.authentication.dtos.PermissionAddDto
(although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance ofcom.hung.authentication.dtos.PermissionAddDto
(although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 2, column: 5]
And I don't know why it not working . But when I add another property to my DTO , it works.