Skip to content

Commit 8bd871e

Browse files
authored
Merge pull request #254 from Thiht/fix/BodyMatcher
fix: MarshalYAML method for BodyMatcher which caused problems during the persistence of mocks
2 parents b4f0156 + 72a0c62 commit 8bd871e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

server/types/matchers.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
log "github.com/sirupsen/logrus"
99
"github.com/smartystreets/assertions"
1010
"github.com/stretchr/objx"
11-
"gopkg.in/yaml.v3"
1211
)
1312

1413
const (
@@ -300,12 +299,9 @@ func (bm *BodyMatcher) UnmarshalJSON(data []byte) error {
300299

301300
func (bm BodyMatcher) MarshalYAML() (interface{}, error) {
302301
if bm.bodyString != nil {
303-
value, err := yaml.Marshal(bm.bodyString)
304-
return string(value), err
302+
return bm.bodyString, nil
305303
}
306-
307-
value, err := yaml.Marshal(bm.bodyJson)
308-
return string(value), err
304+
return bm.bodyJson, nil
309305
}
310306

311307
func (bm *BodyMatcher) UnmarshalYAML(unmarshal func(interface{}) error) error {

0 commit comments

Comments
 (0)