@@ -50,3 +50,14 @@ func BindingForm[T any](c *binding_context.Context, request interface{}, sendFun
return true
}
+
+func BindingXMLForm[T any](c *binding_context.Context, request interface{}, sendFunc response.SendFunc[T]) bool {
+ err := c.ShouldBindXML(request)
+ if err != nil {
+ var zero T
+ sendFunc(c, http.StatusBadRequest, zero, err)
+ return false
+ }
+ return true
+}