d4x1 commented on code in PR #6628:
URL: 
https://github.com/apache/incubator-devlake/pull/6628#discussion_r1429542548


##########
backend/plugins/bitbucket/api/scope.go:
##########
@@ -82,6 +82,25 @@ func GetScopeList(input *plugin.ApiResourceInput) 
(*plugin.ApiResourceOutput, er
        return scopeHelper.GetScopeList(input)
 }
 
+// GetScopeDispatcher process BitBucket repos get request
+// @Summary process BitBucket repos get request
+// @Description process BitBucket repos get request
+// @Tags plugins/bitbucket
+// @Param connectionId path int true "connection ID"
+// @Param scopeId path string true "repo ID"
+// @Success 200  {object} ScopeRes
+// @Failure 400  {object} shared.ApiBody "Bad Request"
+// @Failure 500  {object} shared.ApiBody "Internal Error"
+// @Router /plugins/bitbucket/connections/{connectionId}/scopes/{scopeId} [GET]
+func GetScopeDispatcher(input *plugin.ApiResourceInput) 
(*plugin.ApiResourceOutput, errors.Error) {

Review Comment:
   Let me explain it in detail.
   `ScopeID` in plugin bitbucket is a string with format 
`{string_a}/{string_b}`, eg `thenicetgp/ptest`, then the gin path will be 
`/plugins/bitbucket/connections/{connectionId}/scopes/{string_a}/{string_b}`, 
but `latest-sync-state` api should be 
`/plugins/bitbucket/connections/{connectionId}/scopes/{scope_id}/latest-sync-state`.
 Gin cannot handle it with params in path, more detail: 
https://github.com/gin-gonic/gin/issues/1446. 
   So we have to handle it specially.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to