How to pass date and email values in form-data?

I get the error in response when I pass the form data. Form-data and error response is mentioned below. How do I resolve the issue?

Form-data:

userType: INDIVIDUAL
firstName: Om
middleName: Sharan
lastName: Singh
email: [email protected]
dobAD: 2006-10-18
dobBS: 2063-07-01
age: 18
gender: MALE
phoneNumber: 9841796925
simType: PREPAID
education: SECONDARY
communicationType: WHATSAPP
communicationNumber: 9841796925
maritalStatus: UNMARRIED
fatherName: David Singh
grandFatherName: Mohan Karki
noOfDependent: 3
nationalId: 10001000
citizenshipNumber: 19101023
citizenshipIssuedPlace: 73
citizenshipIssuedDate: 2081-07-15
panNumber: 110000005
panIssuedDate: 2081-07-15
mobileUser: false
kycReferencesDTOS[0].name: Jivan Singh
kycReferencesDTOS[0].contactNo: 9841712345
kycReferencesDTOS[0].relationshipType: FRIEND
kycReferencesDTOS[0].address: Umrer Road
kycReferencesDTOS[1].name: Mathew Rauniyar
kycReferencesDTOS[1].contactNo: 9841796923
kycReferencesDTOS[1].relationshipType: SIBLING
kycReferencesDTOS[1].address: Krishnanagar

Response:

{
    "error": {
        "errorList": [
            {
                "errorCode": 400,
                "errorMessage": "Failed to convert property value of type 'java.lang.String' to required type 'java.time.LocalDate' for property 'dobAD'; Failed to convert from type [java.lang.String] to type [@jakarta.validation.constraints.NotNull java.time.LocalDate] for value ' 2006/10/18'"
            },
            {
                "errorCode": 400,
                "errorMessage": "must be a well-formed email address"
            }
        ]
    },
    "responseCode": "400",
    "message": "Failed to convert property value of type 'java.lang.String' to required type 'java.time.LocalDate' for property 'dobAD'; Failed to convert from type [java.lang.String] to type [@jakarta.validation.constraints.NotNull java.time.LocalDate] for value ' 2006/10/18'",
    "timestamp": "2024-11-01 09:11:19"
}

I can only suggest reading the API specification to see what it will accept.

The first error is telling you that the date format is wrong. It needs to be in the java.time.LocalDate format. (Which isn’t YYYY/MM/DD).

The second error is because its reading the wrong value. It’s reading one of the dates instead of the email address, so check your form data and check the console log for the sent request and confirm what was actually sent.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.