code: func ValidateDir(dir string) (validationErrors []string, err error) {
  	mpath := yamlPath(dir)
  	yml, err := ioutil.ReadFile(mpath)
  	if err != nil {
  		return nil, err
  	}
  
  	jbytes, err := yaml.YAMLToJSON(yml)
  	if err != nil {
  		return nil, errors.Wrap(err, "could not transform YAML to JSON")
  	}
  
  	schemaLoader := gojsonschema.NewReferenceLoader("https://choria.io/schemas/choria/machine/v1/manifest.json")
  	documentLoader := gojsonschema.NewBytesLoader(jbytes)
  
  	result, err := gojsonschema.Validate(schemaLoader, documentLoader)
  	if err != nil {
  		return nil, errors.Wrapf(err, "could not perform schema validation")
  	}
  
  	if result.Valid() {
  		return []string{}, nil
  	}
  
  	validationErrors = []string{}
  	for _, desc := range result.Errors() {
  		validationErrors = append(validationErrors, desc.String())
  	}
  
  	return validationErrors, nil
  }
docs: // ValidateDir validates a machine.yaml against the v1 schema