Skip to content

Commit

Permalink
mockserver adds additional / in path
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Jan 9, 2024
1 parent 5caa538 commit 04c1557
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/mockserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ func (em *MockserverClient) SetValuePath(path string, v int) error {

// SetAnyValuePath sets any type of value for a path
func (em *MockserverClient) SetAnyValuePath(path string, v interface{}) error {
if !strings.HasPrefix(path, "/") {
path = fmt.Sprintf("/%s", path)
}
sanitizedPath := strings.ReplaceAll(path, "/", "_")
id := fmt.Sprintf("%s_mock_id", sanitizedPath)
log.Debug().Str("ID", id).
Expand Down

0 comments on commit 04c1557

Please sign in to comment.