code: func (v Validator) Validate(src io.Reader) error {
  	buf, err := ioutil.ReadAll(src)
  	if err != nil {
  		return errors.Wrap(err, "unable to read the document file")
  	}
  
  	if f, ok := mapValidate[v]; ok {
  		if f == nil {
  			return fmt.Errorf("internal error: mapValidate[%q] is nil", v)
  		}
  		err = f(bytes.NewReader(buf))
  		if err != nil {
  			return err
  		}
  	}
  
  	sl := newFSLoaderFactory(schemaNamespaces, fs).New(specs[v])
  	ml := gojsonschema.NewStringLoader(string(buf))
  
  	result, err := gojsonschema.Validate(sl, ml)
  	if err != nil {
  		return errors.Wrapf(
  			WrapSyntaxError(bytes.NewReader(buf), err),
  			"schema %s: unable to validate", v)
  	}
  
  	if result.Valid() {
  		return nil
  	}
  
  	errs := make([]error, 0, len(result.Errors()))
  	for _, desc := range result.Errors() {
  		errs = append(errs, fmt.Errorf("%s", desc))
  	}
  
  	return ValidationError{
  		Errs: errs,
  	}
  }
docs: // Validate validates the given reader against the schema of the wrapped media type.