healchow commented on code in PR #4869:
URL: https://github.com/apache/inlong/pull/4869#discussion_r913392357


##########
inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/source/SourceRequest.java:
##########
@@ -35,21 +39,26 @@
 @JsonTypeInfo(use = Id.NAME, visible = true, property = "sourceType")
 public class SourceRequest {
 
+    @NotNull(groups = UpdateValidation.class)
+    @ApiModelProperty(value = "Primary key")
     private Integer id;
 
-    @NotBlank(message = "inlongGroupId cannot be null")
+    @NotBlank(message = "inlongGroupId cannot be blank")
     @ApiModelProperty("Inlong group id")
     private String inlongGroupId;
 
-    @NotBlank(message = "inlongStreamId cannot be null")
+    @NotBlank(message = "inlongStreamId cannot be blank")
     @ApiModelProperty("Inlong stream id")
     private String inlongStreamId;
 
-    @NotBlank(message = "sourceType cannot be null")
+    @NotBlank(message = "sourceType cannot be blank")
     @ApiModelProperty("Source type, including: FILE, KAFKA, etc.")
     private String sourceType;
 
-    @NotBlank(message = "sourceName cannot be null")
+    @NotBlank(message = "sourceName cannot be blank")
+    @Length(min = 1, max = 100, message = "sourceName length must be between 1 
and 100")
+    @Pattern(regexp = "^[a-z0-9_-]{1,100}$",
+            message = "sourceName only supports lowercase letters, numbers, 
'_', or '_'")

Review Comment:
   Change it.



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