ppapou commented on a change in pull request #588: [Dlab-1422] The endpoint URL 
verification
URL: https://github.com/apache/incubator-dlab/pull/588#discussion_r378894620
 
 

 ##########
 File path: 
services/self-service/src/main/java/com/epam/dlab/backendapi/domain/EndpointDTO.java
 ##########
 @@ -23,14 +23,22 @@
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
+import org.hibernate.validator.constraints.NotEmpty;
+import org.hibernate.validator.constraints.URL;
 
 
 @Data
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class EndpointDTO {
-
+       /*
+        the URL_REGEXP_VALIDATION constant is a template for URL pattern,
+         i.e for url verification like "https://localhost:8084/a/$-*^.oLeh;/";
+        */
+       private static final String URL_REGEXP_VALIDATION = 
"^(http(s)?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
+       private static final String URL_RESPONSE_MESSAGE = "is empty or 
contains improper format, symbols ";
 
 Review comment:
   Yeap, a common message looks better.
   What do you think, if we apply the javax Pattern annotation to validate the 
Name field? 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to