code: func (sm *serverMethod) setup(apiDef *raml.APIDefinition, r *raml.Resource, rd *resource.Resource, resourceParams []string) error {
  	sm.MethodName = commons.SnackCaseServerMethodName(sm.DisplayName, sm.Verb(), r)
  
  	if commons.HasJSONBody(&(sm.Bodies)) {
  		// TODO : make it to call proper func
  		sm.reqBody = casee.ToPascalCase(sm.MethodName + commons.ReqBodySuffix)
  	}
  
  	sm.Params = strings.Join(resourceParams, ", ")
  	sm.Endpoint = strings.Replace(sm.Endpoint, "{", "<", -1)
  	sm.Endpoint = strings.Replace(sm.Endpoint, "}", ">", -1)
  
  	// security middlewares
  	for _, v := range sm.SecuredBy {
  		if !security.ValidateScheme(v.Name, apiDef) {
  			continue
  		}
  		// oauth2 middleware
  		m, err := newPythonOauth2Middleware(v)
  		if err != nil {
  			log.Errorf("error creating middleware for method.err = %v", err)
  			return err
  		}
  		sm.MiddlewaresArr = append(sm.MiddlewaresArr, m)
  	}
  	return nil
  }
docs: // setup sets all needed variables