Commit f02304e2f347798c28c67330cfe77e778ae643a3
Committed by
Andrew Shvayka
1 parent
de44eb44
Add max fields length validation
Showing
5 changed files
with
5 additions
and
1 deletions
... | ... | @@ -35,6 +35,7 @@ public class DashboardInfo extends SearchTextBased<DashboardId> implements HasNa |
35 | 35 | @NoXss |
36 | 36 | @Length(fieldName = "title") |
37 | 37 | private String title; |
38 | + @Length(fieldName = "image", max = 1000000) | |
38 | 39 | private String image; |
39 | 40 | @Valid |
40 | 41 | private Set<ShortCustomerInfo> assignedCustomers; | ... | ... |
... | ... | @@ -54,6 +54,7 @@ public class DeviceProfile extends SearchTextBased<DeviceProfileId> implements H |
54 | 54 | @NoXss |
55 | 55 | @ApiModelProperty(position = 11, value = "Device Profile description. ") |
56 | 56 | private String description; |
57 | + @Length(fieldName = "image", max = 1000000) | |
57 | 58 | @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. ") |
58 | 59 | private String image; |
59 | 60 | private boolean isDefault; | ... | ... |
... | ... | @@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.validation.NoXss; |
26 | 26 | @JsonPropertyOrder({ "alias", "name", "image", "description", "descriptor" }) |
27 | 27 | public class WidgetTypeDetails extends WidgetType { |
28 | 28 | |
29 | - @NoXss | |
29 | + @Length(fieldName = "image", max = 1000000) | |
30 | 30 | @ApiModelProperty(position = 8, value = "Base64 encoded thumbnail", readOnly = true) |
31 | 31 | private String image; |
32 | 32 | @NoXss | ... | ... |
... | ... | @@ -50,6 +50,7 @@ public class WidgetsBundle extends SearchTextBased<WidgetsBundleId> implements H |
50 | 50 | @ApiModelProperty(position = 5, value = "Title used in search and UI", readOnly = true) |
51 | 51 | private String title; |
52 | 52 | |
53 | + @Length(fieldName = "image", max = 1000000) | |
53 | 54 | @Getter |
54 | 55 | @Setter |
55 | 56 | @ApiModelProperty(position = 6, value = "Base64 encoded thumbnail", readOnly = true) | ... | ... |