Skip to content

Commit

Permalink
Add validate=false to PATCH request to allow more atomic operations (#65
Browse files Browse the repository at this point in the history
)
  • Loading branch information
anvitha-jain authored Sep 10, 2021
1 parent 9f5e92a commit 15d4715
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/client_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package client
import (
"errors"
"fmt"
"net/url"

"github.com/ciscoecosystem/mso-go-client/container"
"github.com/ciscoecosystem/mso-go-client/models"
Expand Down Expand Up @@ -113,7 +114,13 @@ func (c *Client) PatchbyID(endpoint string, objList ...models.Model) (*container

}

req, err := c.MakeRestRequest("PATCH", endpoint, contJs, true)
// URL encoding
baseUrl, _ := url.Parse(endpoint)
qs := url.Values{}
qs.Add("validate", "false")
baseUrl.RawQuery = qs.Encode()

req, err := c.MakeRestRequest("PATCH", baseUrl.String(), contJs, true)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 15d4715

Please sign in to comment.