code: func (m *DeserializedManifest) UnmarshalJSON(b []byte) error {
  	m.canonical = make([]byte, len(b))
  	// store manifest in canonical
  	copy(m.canonical, b)
  
  	// Unmarshal canonical JSON into Manifest object
  	var manifest Manifest
  	if err := json.Unmarshal(m.canonical, &manifest); err != nil {
  		return err
  	}
  
  	if manifest.MediaType != "" && manifest.MediaType != v1.MediaTypeImageManifest {
  		return fmt.Errorf("if present, mediaType in manifest should be '%s' not '%s'",
  			v1.MediaTypeImageManifest, manifest.MediaType)
  	}
  
  	m.Manifest = manifest
  
  	return nil
  }
docs: // UnmarshalJSON populates a new Manifest struct from JSON data.