asdf.schema.validate(instance, ctx=None, schema=None, validators=None, reading=False, *args, **kwargs)[source]

Validate the given instance (which must be a tagged tree) against the appropriate schema. The schema itself is located using the tag on the instance.

The additional *args and **kwargs are passed along to validate.

instancetagged tree
ctxAsdfFile context

Used to resolve tags and urls

schemaschema, optional

Explicit schema to use. If not provided, the schema to use is determined by the tag on instance (or subinstance).

validatorsdict, optional

A dictionary mapping properties to validators to use (instead of the built-in ones and ones provided by extension types).

reading: bool, optional

Indicates whether validation is being performed when the file is being read. This is useful to allow for different validation behavior when reading vs writing files.