From 166d45efe6de92ce067bc7b6065a0d7de94a6388 Mon Sep 17 00:00:00 2001 From: franciscovila Date: Tue, 18 Oct 2022 16:02:02 +0100 Subject: Fix property constraints validation Fix property constraints validation behaviour when a property is not required shouldnt be validated vs constraints if no value is provided. Also add constraints validation for length measures in list, map and string types. Issue-ID: SDC-4222 Signed-off-by: franciscovila Change-Id: I48ebb46b3de9ddac3d9dd91400ea0fad983aa94d --- .../resources/types/datatypes/constraintTest.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'catalog-be/src/test/resources/types/datatypes/constraintTest.json') diff --git a/catalog-be/src/test/resources/types/datatypes/constraintTest.json b/catalog-be/src/test/resources/types/datatypes/constraintTest.json index 83b4253939..a9d1469068 100644 --- a/catalog-be/src/test/resources/types/datatypes/constraintTest.json +++ b/catalog-be/src/test/resources/types/datatypes/constraintTest.json @@ -128,6 +128,11 @@ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.value_specs", "type": "map", "required": false, + "constraints": [ + { + "minLength": 2 + } + ], "definition": false, "defaultValue": "{}", "description": "Extra parameters to include in the request", @@ -186,6 +191,14 @@ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.subnetpool", "type": "string", "required": false, + "constraints": [ + { + "minLength": "2" + }, + { + "maxLength": "4" + } + ], "definition": false, "description": "The name or ID of the subnet pool", "password": false, @@ -198,6 +211,14 @@ "uniqueId": "org.openecomp.datatypes.heat.network.neutron.Subnet.datatype.dns_nameservers", "type": "list", "required": false, + "constraints": [ + { + "minLength": "2" + }, + { + "maxLength": "4" + } + ], "definition": false, "defaultValue": "[]", "description": "A specified set of DNS name servers to be used", -- cgit 1.2.3-korg