@@ -74,7 +74,7 @@ func parseType(from, to reflect.Value, fieldName string) IErrorArgs {
func realValue(val reflect.Value) reflect.Value {
if val.Kind() == reflect.Ptr || val.Kind() == reflect.Interface {
//if val.Kind() == reflect.Interface {
- if val.IsNil() && val.Kind() == reflect.Ptr {
+ if val.IsNil() && val.Kind() == reflect.Ptr && val.CanSet() {
val.Set(reflect.New(val.Type().Elem()))
}
// check
@@ -406,6 +406,7 @@ type AuthEmail struct {
Email string `rest:"required" example:"mail@mail.ml"`
ThemeName string `rest:"required"`
UUser *User
+ Fields []any
func (s *AuthEmail) Validate(req IRequestIn) IRequestOut {
@@ -434,8 +435,8 @@ func TestSerializeEmail(t *testing.T) {
"email": "flint@77i.su",
"themeName": "th-name",
"UUser": json.Map{
- "ID": 100,
- "Name": "User 100",
+ "ID": 100,
+ //"Name": "User 100",
"Created": "10.11.1983 03:12",
"ParentID": nil,
},