code: func (g *GenOpts) SpecPath() string {
  	if strings.HasPrefix(g.Spec, "http://") || strings.HasPrefix(g.Spec, "https://") {
  		return g.Spec
  	}
  	// Local specifications
  	specAbs, _ := filepath.Abs(g.Spec)
  	var tgt string
  	if g.Target == "" {
  		tgt = "." // That's for windows
  	} else {
  		tgt = g.Target
  	}
  	tgtAbs, _ := filepath.Abs(tgt)
  	srvPkg := filepath.FromSlash(g.LanguageOpts.ManglePackagePath(g.ServerPackage, "server"))
  	srvAbs := filepath.Join(tgtAbs, srvPkg)
  	specRel, err := filepath.Rel(srvAbs, specAbs)
  	if err != nil {
  		return specAbs
  	}
  	return specRel
  }
docs: // SpecPath returns the path to the spec relative to the server package.
  // If the spec is remote keep this absolute location.
  //
  // If spec is not relative to server (e.g. lives on a different drive on windows),
  // then the resolved path is absolute.
  //
  // This method is used by templates, e.g. with {{ .SpecPath }}
  //
  // Errors cases are prevented by calling CheckOpts beforehand.