File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package handlers
18
18
import (
19
19
"github.com/go-openapi/runtime/middleware"
20
20
client_native "github.com/haproxytech/client-native/v6"
21
+ client_conf "github.com/haproxytech/client-native/v6/configuration"
21
22
"github.com/haproxytech/client-native/v6/models"
22
23
cn "github.com/haproxytech/dataplaneapi/client-native"
23
24
"github.com/haproxytech/dataplaneapi/haproxy"
@@ -82,6 +83,13 @@ func (h *ReplaceGlobalHandlerImpl) Handle(params global.ReplaceGlobalParams, pri
82
83
}
83
84
return global .NewReplaceGlobalDefault (int (* e .Code )).WithPayload (e )
84
85
}
86
+ // validate constraints that can not be validated by the swagger 2.0 spec.
87
+ if err := client_conf .ValidateGlobalSection (params .Data ); err != nil {
88
+ code := misc .ErrHTTPBadRequest
89
+ msg := err .Error ()
90
+ e := & models.Error {Code : & code , Message : & msg }
91
+ return global .NewReplaceGlobalDefault (int (misc .ErrHTTPBadRequest )).WithPayload (e )
92
+ }
85
93
86
94
err := h .pushGlobalConfiguration (params , t , v )
87
95
if err != nil {
You can’t perform that action at this time.
0 commit comments