Getting DateTimeParseException in restApi

I am getting DateTimeParseException while trying to add data in database using rest api.

command :
curl -X POST http://localhost:8080/rest/entities/xyz -H “Authorization: Bearer access-token” -H “Content-Type: application/json” -d “{\“date\”:\“01\/01\/2011\”}”

Java Entity Code :
@JmixEntity
@Table(name = “XYZ”)
@Entity(name = “xyz”)
public class TripDetails {

@Column(name = “DATE_”)
private LocalDate date;

}

Error :
java.time.format.DateTimeParseException: Text ‘01/01/2011’ could not be parsed at index 0

How do I resolve this issue ?

Thanks in advance

Hi,
I think “LocalDate” in Jmix has this format → “yyyy/MM/dd”, So I believe you have to insert in that order then use formatter to display the way you want

Can we change the date format.

Already tried datetimeformat of jmix and springframework.

They don’t work.

Also, in your sample ‘/’ doesn’t work, it has to be ‘yyyy-mm-dd’

No, generic REST works with ISO date and time formats. See DateTimeFormatter.