code: func (s *Server) Generate() error {
  	apiDef := new(raml.APIDefinition)
  	// parse the raml file
  	dir, fileName := filepath.Split(s.RAMLFile)
  	ramlBytes, err := raml.ParseReadFile(dir, fileName, apiDef)
  	if err != nil {
  		return err
  	}
  
  	var generator generator.Server
  
  	switch s.Lang {
  	case langGo:
  		generator = golang.NewServer(apiDef, s.PackageName, s.APIDocsDir, s.RootImportPath, s.WithMain,
  			s.Dir, s.LibRootURLs)
  	case langPython:
  		generator = python.NewServer(s.Kind, apiDef, s.APIDocsDir, s.Dir, s.WithMain, s.LibRootURLs)
  	case langNim:
  		generator = nim.NewServer(apiDef, s.APIDocsDir, s.Dir)
  	case langTarantool:
  		generator = tarantool.NewServer(apiDef, s.APIDocsDir, s.Dir)
  	default:
  		return errInvalidLang
  	}
  	err = generator.Generate()
  	if err != nil {
  		return err
  	}
  
  	if s.APIDocsDir == "" {
  		return nil
  	}
  
  	if s.Lang == langNim {
  		s.APIDocsDir = "public/" + s.APIDocsDir
  	}
  
  	log.Infof("Generating API Docs to %v", s.APIDocsDir)
  
  	return apidocs.Generate(apiDef, s.RAMLFile, ramlBytes, filepath.Join(s.Dir, s.APIDocsDir), s.LibRootURLs)
  }
docs: // Generate generates API server files