Skip to content

Commit 95e96a6

Browse files
authored
jsonschema: improve Resolved.Validate doc (#81)
1 parent bfb9215 commit 95e96a6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

jsonschema/validate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const draft202012 = "https://json-schema.org/draft/2020-12/schema"
2525

2626
// Validate validates the instance, which must be a JSON value, against the schema.
2727
// It returns nil if validation is successful or an error if it is not.
28+
// If the schema type is "object", instance can be a map[string]any or a struct.
2829
func (rs *Resolved) Validate(instance any) error {
2930
if s := rs.root.Schema; s != "" && s != draft202012 {
3031
return fmt.Errorf("cannot validate version %s, only %s", s, draft202012)

0 commit comments

Comments
 (0)