code: func getOauth2MwrHandler(ss raml.DefinitionChoice) (string, error) {
  	// construct security scopes
  	quotedScopes, err := security.GetQuotedScopes(ss)
  	if err != nil {
  		return "", err
  	}
  	scopesArgs := strings.Join(quotedScopes, ", ")
  
  	// middleware name
  	// need to handle case where it reside in different package
  	var packageName string
  	name := ss.Name
  
  	if splitted := strings.Split(name, "."); len(splitted) == 2 {
  		packageName = splitted[0]
  		name = splitted[1]
  	}
  	mwr := fmt.Sprintf(`NewOauth2%vMiddleware([]string{%v}).Handler`, name, scopesArgs)
  	if packageName != "" {
  		mwr = packageName + "." + mwr
  	}
  	return mwr, nil
  }
docs: // get oauth2 middleware handler from a security scheme