dubeejw commented on a change in pull request #170: Initial code checkin for 
path parameter support
URL: 
https://github.com/apache/incubator-openwhisk-cli/pull/170#discussion_r164938466
 
 

 ##########
 File path: commands/api.go
 ##########
 @@ -768,6 +831,19 @@ func parseApi(cmd *cobra.Command, args []string) 
(*whisk.Api, *QualifiedName, er
                api.GatewayRelPath = args[0] // Maintain case as URLs may be 
case-sensitive
        }
 
+       // Attempting to use path parameters, lets validate that they provided 
them correctly.
+       hasPathParams := hasPathParameters(api.GatewayRelPath)
+       if err = validatePathParameters(api.GatewayRelPath); hasPathParams && 
err != nil {
 
 Review comment:
   Seems like you can get around calling the same regex match twice here by 
making `hasPathParameters` a multi-value retruning function, which returns the 
parameter and the error.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to