Skip to content

Commit

Permalink
tests: fix Example_extension
Browse files Browse the repository at this point in the history
instance must be parsed into json before validate
  • Loading branch information
santhosh-tekuri committed Jan 30, 2022
1 parent 631ba8c commit 2ee8058
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion example_extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ func Example_extension() {
log.Fatalf("%#v", err)
}

if err = sch.Validate(strings.NewReader(instance)); err != nil {
var v interface{}
if err := json.Unmarshal([]byte(instance), &v); err != nil {
log.Fatal(err)
}

if err = sch.Validate(v); err != nil {
log.Fatalf("%#v", err)
}
// Output:
Expand Down

0 comments on commit 2ee8058

Please sign in to comment.