Add max fields length validation
This commit is contained in:
parent
de44eb4440
commit
f02304e2f3
@ -44,6 +44,7 @@ public abstract class ContactBased<I extends UUIDBased> extends SearchTextBasedW
|
||||
@Length(fieldName = "phone")
|
||||
@NoXss
|
||||
protected String phone;
|
||||
@Length(fieldName = "email")
|
||||
@NoXss
|
||||
protected String email;
|
||||
|
||||
|
||||
@ -35,6 +35,7 @@ public class DashboardInfo extends SearchTextBased<DashboardId> implements HasNa
|
||||
@NoXss
|
||||
@Length(fieldName = "title")
|
||||
private String title;
|
||||
@Length(fieldName = "image", max = 1000000)
|
||||
private String image;
|
||||
@Valid
|
||||
private Set<ShortCustomerInfo> assignedCustomers;
|
||||
|
||||
@ -54,6 +54,7 @@ public class DeviceProfile extends SearchTextBased<DeviceProfileId> implements H
|
||||
@NoXss
|
||||
@ApiModelProperty(position = 11, value = "Device Profile description. ")
|
||||
private String description;
|
||||
@Length(fieldName = "image", max = 1000000)
|
||||
@ApiModelProperty(position = 12, value = "Either URL or Base64 data of the icon. Used in the mobile application to visualize set of device profiles in the grid view. ")
|
||||
private String image;
|
||||
private boolean isDefault;
|
||||
|
||||
@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.validation.NoXss;
|
||||
@JsonPropertyOrder({ "alias", "name", "image", "description", "descriptor" })
|
||||
public class WidgetTypeDetails extends WidgetType {
|
||||
|
||||
@NoXss
|
||||
@Length(fieldName = "image", max = 1000000)
|
||||
@ApiModelProperty(position = 8, value = "Base64 encoded thumbnail", readOnly = true)
|
||||
private String image;
|
||||
@NoXss
|
||||
|
||||
@ -50,6 +50,7 @@ public class WidgetsBundle extends SearchTextBased<WidgetsBundleId> implements H
|
||||
@ApiModelProperty(position = 5, value = "Title used in search and UI", readOnly = true)
|
||||
private String title;
|
||||
|
||||
@Length(fieldName = "image", max = 1000000)
|
||||
@Getter
|
||||
@Setter
|
||||
@ApiModelProperty(position = 6, value = "Base64 encoded thumbnail", readOnly = true)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user