astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- asdf v »
- Developer API »
- validate

# validate

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

  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`.

  Parameters:
    instance tagged tree
    ctx AsdfFile context

      Used to resolve tags and urls

    schema schema, optional

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

    validators dict, 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.