code: func (self *Scheme) embeddedObjectToRawExtension(in *EmbeddedObject, out *RawExtension, s conversion.Scope) error {
  	if in.Object == nil {
  		out.RawJSON = []byte("null")
  		return nil
  	}
  
  	// Figure out the type and kind of the output object.
  	_, outGroupVersionString, scheme := self.fromScope(s)
  	objKind, err := scheme.raw.ObjectKind(in.Object)
  	if err != nil {
  		return err
  	}
  	outVersion, err := unversioned.ParseGroupVersion(outGroupVersionString)
  	if err != nil {
  		return err
  	}
  
  	// Manufacture an object of this type and kind.
  	outObj, err := scheme.New(outVersion.WithKind(objKind.Kind))
  	if err != nil {
  		return err
  	}
  
  	// Manually do the conversion.
  	err = s.Convert(in.Object, outObj, 0)
  	if err != nil {
  		return err
  	}
  
  	// Copy the kind field into the output object.
  	err = s.Convert(
  		&emptyPlugin{PluginBase: PluginBase{Kind: objKind.Kind}},
  		outObj,
  		conversion.SourceToDest|conversion.IgnoreMissingFields|conversion.AllowDifferentFieldTypeNames,
  	)
  	if err != nil {
  		return err
  	}
  	// Because we provide the correct version, EncodeToVersion will not attempt a conversion.
  	raw, err := scheme.EncodeToVersion(outObj, outVersion.String())
  	if err != nil {
  		// TODO: if this fails, create an Unknown-- maybe some other
  		// component will understand it.
  		return err
  	}
  	out.RawJSON = raw
  	return nil
  }
docs: // embeddedObjectToRawExtension does the conversion you would expect from the name, using the information
  // given in conversion.Scope. It's placed in the DefaultScheme as a ConversionFunc to enable plugins;
  // see the comment for RawExtension.