code: func (v *StreamVisitor) Visit(fn VisitorFunc) error {
  	d := yaml.NewYAMLOrJSONDecoder(v.Reader, 4096)
  	for {
  		ext := runtime.RawExtension{}
  		if err := d.Decode(&ext); err != nil {
  			if err == io.EOF {
  				return nil
  			}
  			return fmt.Errorf("error parsing %s: %v", v.Source, err)
  		}
  		// TODO: This needs to be able to handle object in other encodings and schemas.
  		ext.Raw = bytes.TrimSpace(ext.Raw)
  		if len(ext.Raw) == 0 || bytes.Equal(ext.Raw, []byte("null")) {
  			continue
  		}
  		if err := ValidateSchema(ext.Raw, v.Schema); err != nil {
  			return fmt.Errorf("error validating %q: %v", v.Source, err)
  		}
  		info, err := v.infoForData(ext.Raw, v.Source)
  		if err != nil {
  			if fnErr := fn(info, err); fnErr != nil {
  				return fnErr
  			}
  			continue
  		}
  		if err := fn(info, nil); err != nil {
  			return err
  		}
  	}
  }
docs: // Visit implements Visitor over a stream. StreamVisitor is able to distinct multiple resources in one stream.