|
|
@ -286,7 +286,7 @@ func Longitude[T any](t T) bool { |
|
|
|
// JSON is the validation function for validating if the current field's value is a valid json string.
|
|
|
|
// JSON is the validation function for validating if the current field's value is a valid json string.
|
|
|
|
func JSON[T any](t T) bool { |
|
|
|
func JSON[T any](t T) bool { |
|
|
|
rv := reflect.ValueOf(t) |
|
|
|
rv := reflect.ValueOf(t) |
|
|
|
if rv.Type() == bytesType { |
|
|
|
if rv.Type() == nilType { |
|
|
|
return json.Valid(rv.Bytes()) |
|
|
|
return json.Valid(rv.Bytes()) |
|
|
|
} |
|
|
|
} |
|
|
|
if rv.Kind() == reflect.String { |
|
|
|
if rv.Kind() == reflect.String { |
|
|
|