We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfb9215 commit 95e96a6Copy full SHA for 95e96a6
jsonschema/validate.go
@@ -25,6 +25,7 @@ const draft202012 = "https://json-schema.org/draft/2020-12/schema"
25
26
// Validate validates the instance, which must be a JSON value, against the schema.
27
// 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.
29
func (rs *Resolved) Validate(instance any) error {
30
if s := rs.root.Schema; s != "" && s != draft202012 {
31
return fmt.Errorf("cannot validate version %s, only %s", s, draft202012)
0 commit comments