Skip to content

Commit

Permalink
Fix syntax error in meta-schema validation example snippet
Browse files Browse the repository at this point in the history
The previous snippet resulted in the error:
```
invalid character '$' looking for beginning of object key string
```

Rather than the intended error:
```
multipleOf: Invalid type. Expected: number, given: boolean
```
  • Loading branch information
per1234 authored and johandorland committed Oct 27, 2020
1 parent 065759f commit b076d39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ The following example will produce an error as `multipleOf` must be a number. If
sl := gojsonschema.NewSchemaLoader()
sl.Validate = true
err := sl.AddSchemas(gojsonschema.NewStringLoader(`{
$id" : "http://some_host.com/invalid.json",
"$id" : "http://some_host.com/invalid.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"multipleOf" : true
}`))
Expand Down

0 comments on commit b076d39

Please sign in to comment.