You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/03 13:48:32 UTC

[GitHub] [apisix-dashboard] nic-chen commented on a change in pull request #655: test: add linter for manager api

nic-chen commented on a change in pull request #655:
URL: https://github.com/apache/apisix-dashboard/pull/655#discussion_r515825385



##########
File path: api/conf/conf.go
##########
@@ -36,8 +36,8 @@ const (
 	EnvDEV   = "dev"
 	EnvLOCAL = "local"
 
-	confPath   = "/go/manager-api/conf.json"
-	schemaPath = "/go/manager-api/schema.json"
+	confJsonPath = "/go/manager-api/conf.json"

Review comment:
       fix lint err.

##########
File path: api/conf/conf.go
##########
@@ -36,8 +36,8 @@ const (
 	EnvDEV   = "dev"
 	EnvLOCAL = "local"
 
-	confPath   = "/go/manager-api/conf.json"
-	schemaPath = "/go/manager-api/schema.json"
+	confJsonPath = "/go/manager-api/conf.json"

Review comment:
       @moonming 
   it's a history issue, we have a plan to refactor the config part in `2.1`

##########
File path: api/filter/logging.go
##########
@@ -42,16 +43,17 @@ func RequestLogHandler() gin.HandlerFunc {
 
 		param, _ := c.Get("requestBody")
 
-		switch param.(type) {
+		switch paramType := param.(type) {
 		case []byte:
 			param = string(param.([]byte))
+			fmt.Printf("type of param: %#v", paramType)

Review comment:
       Sorry, the original log library does not support info, warn, etc.. levels, need to submit another PR to do this.

##########
File path: api/filter/logging.go
##########
@@ -42,16 +43,17 @@ func RequestLogHandler() gin.HandlerFunc {
 
 		param, _ := c.Get("requestBody")
 
-		switch param.(type) {
+		switch paramType := param.(type) {
 		case []byte:
 			param = string(param.([]byte))
+			fmt.Printf("type of param: %#v", paramType)

Review comment:
       I change to log first.

##########
File path: api/internal/core/store/validate.go
##########
@@ -88,14 +89,17 @@ func NewAPISIXJsonSchemaValidator(jsonPath string) (Validator, error) {
 }
 
 func getPlugins(reqBody interface{}) map[string]interface{} {
-	switch reqBody.(type) {
+	switch bodyType := reqBody.(type) {
 	case *entity.Route:
+		log.Printf("type of reqBody: %#v", bodyType)

Review comment:
       Sorry, the original log library does not support info, warn, etc.. levels, need to submit another PR to do this.
   
   

##########
File path: api/filter/logging.go
##########
@@ -46,7 +46,7 @@ func RequestLogHandler() gin.HandlerFunc {
 		switch paramType := param.(type) {
 		case []byte:
 			param = string(param.([]byte))
-			fmt.Printf("type of param: %#v", paramType)
+			log.Printf("type of param: %#v", paramType)

Review comment:
       OK.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org