-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
i create request and using validator like this :
type CreateKtpRequest struct {
NIK stringjson:"nik" validate:"numeric,min=16,max=16,required,unique=NIK"
Nama stringjson:"nama" validate:"required"
TempatLahir stringjson:"tempat_lahir"
TanggalLahir stringjson:"tanggal_lahir"
JenisKelamin stringjson:"jenis_kelamin"
Alamat stringjson:"alamat"
Agama stringjson:"agama"
Pekerjaan stringjson:"pekerjaan"
}
but my API produces an error like this
"code": "99",
"message": "Validation Error",
"data": {
"NIK": "Key: 'CreateKtpRequest.NIK' Error:Field validation for 'NIK' failed on the 'unique' tag"
}
I have made sure that the data I entered is not duplicated, all tag working normal except unique tag