X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Frestapi%2Foperations%2Fa1_mediator%2Fa1_controller_create_policy_type.go;h=74309786d600df1d692f3b7e588713be21ecb75c;hb=9138f03524117e1cc5eb42384dbf5be79cd33e9d;hp=28aef97b8f019fc4cad415bc2ce7b4fd8b461c29;hpb=b7a743adb64d9a737e505d54fbdbe46777551d06;p=ric-plt%2Fa1.git diff --git a/pkg/restapi/operations/a1_mediator/a1_controller_create_policy_type.go b/pkg/restapi/operations/a1_mediator/a1_controller_create_policy_type.go index 28aef97..7430978 100644 --- a/pkg/restapi/operations/a1_mediator/a1_controller_create_policy_type.go +++ b/pkg/restapi/operations/a1_mediator/a1_controller_create_policy_type.go @@ -49,7 +49,7 @@ func NewA1ControllerCreatePolicyType(ctx *middleware.Context, handler A1Controll return &A1ControllerCreatePolicyType{Context: ctx, Handler: handler} } -/*A1ControllerCreatePolicyType swagger:route PUT /a1-p/policytypes/{policy_type_id} A1 Mediator a1ControllerCreatePolicyType +/* A1ControllerCreatePolicyType swagger:route PUT /a1-p/policytypes/{policy_type_id} A1 Mediator a1ControllerCreatePolicyType Create a new policy type . Replace is not currently allowed; to replace, for now do a DELETE and then a PUT again. @@ -63,17 +63,15 @@ type A1ControllerCreatePolicyType struct { func (o *A1ControllerCreatePolicyType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { route, rCtx, _ := o.Context.RouteInfo(r) if rCtx != nil { - r = rCtx + *r = *rCtx } var Params = NewA1ControllerCreatePolicyTypeParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params o.Context.Respond(rw, r, route.Produces, route, err) return } res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) }