mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-25 18:30:00 +00:00
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:
parent
a2804a8933
commit
d696a0c6e7
@ -265,6 +265,14 @@ public class TypeRepository extends EntityRepository<Type> {
|
|||||||
if (uniqueColumns.size() != columns.size()) {
|
if (uniqueColumns.size() != columns.size()) {
|
||||||
throw new IllegalArgumentException("Column names must be unique.");
|
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 {
|
try {
|
||||||
JsonUtils.validateJsonSchema(config.getConfig(), TableConfig.class);
|
JsonUtils.validateJsonSchema(config.getConfig(), TableConfig.class);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user