code: func (a Application) MarshalJSON() ([]byte, error) {
  	ccApp := ccApplication{
  		Name:          a.Name,
  		Relationships: a.Relationships,
  		Metadata:      a.Metadata,
  	}
  
  	if a.LifecycleType == constant.AppLifecycleTypeDocker {
  		ccApp.setDockerLifecycle()
  	} else if a.LifecycleType == constant.AppLifecycleTypeBuildpack {
  		if len(a.LifecycleBuildpacks) > 0 || a.StackName != "" {
  			if a.hasAutodetectedBuildpack() {
  				ccApp.setAutodetectedBuildpackLifecycle(a)
  			} else {
  				ccApp.setBuildpackLifecycle(a)
  			}
  		}
  	}
  
  	return json.Marshal(ccApp)
  }
docs: // MarshalJSON converts an Application into a Cloud Controller Application.