Minor: Add column count validation when creating table-type custom property (#20418)

* Minor: Add column count validation when creating table-type custom property

* Minor: Add column count validation when creating table-type custom property
This commit is contained in:
sonika-shah 2025-03-26 11:47:44 +05:30 committed by GitHub
parent a2804a8933
commit d696a0c6e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -265,6 +265,14 @@ public class TypeRepository extends EntityRepository<Type> {
if (uniqueColumns.size() != columns.size()) {
throw new IllegalArgumentException("Column names must be unique.");
}
if (columns.size() < tableConfig.getMinColumns()
|| columns.size() > tableConfig.getMaxColumns()) {
throw new IllegalArgumentException(
"Custom Property table has invalid value columns size must be between "
+ tableConfig.getMinColumns()
+ " and "
+ tableConfig.getMaxColumns());
}
try {
JsonUtils.validateJsonSchema(config.getConfig(), TableConfig.class);