You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// example
type Params struct {
Pa string `form:"pa"` // which can success bind via form_mapping
Pb *string `form:"pb"` // which cannot bind via form_mapping
}
The reason is fieldKind in "func setWithProperType()" have not pointer type.
Supporting pointer fields bind is useful we can easy know whether we pass the param. if we not passing it, it will keep nil value.
In Json Unmarshal can process pointer field also.
So do you think supporting pointer field parse in binding/form_mapping.go is a good idea?
The text was updated successfully, but these errors were encountered:
Is it possible to differentiate between a boolean pointer parameter being nil, true, or false?
If I don't set the parameter in a query it results to false but I would like it to be nil.
Is there a way to explicitly set pointer parameter to nil?
I see code in https://github.com/gin-gonic/gin/blob/master/binding/form_mapping.go, we can only support value field bind, do not support pointer type.
The reason is fieldKind in "func setWithProperType()" have not pointer type.
Supporting pointer fields bind is useful we can easy know whether we pass the param. if we not passing it, it will keep nil value.
In Json Unmarshal can process pointer field also.
So do you think supporting pointer field parse in binding/form_mapping.go is a good idea?
The text was updated successfully, but these errors were encountered: