Commented code which add non mandatory field as empty field if there are

no mandatory fields
This commit is contained in:
Luca Frosini 2021-02-10 12:26:12 +01:00
parent 51b76c89e6
commit eb8e0b7bea
2 changed files with 4 additions and 0 deletions

View File

@ -337,9 +337,11 @@ public class Validator {
// if there was no field with this key and it was not mandatory, just add an entry of the kind {"key": "key-value", "value" : ""}.
// Sometimes it is important to view the field as empty.
/*
if(fieldsFoundWithThisKey == 0 && !metadataField.getMandatory()) {
toReturn.add(new CustomField(metadataFieldName, "", -1, -1));
}
*/
return toReturn;

View File

@ -307,10 +307,12 @@ public class CKANPackageTest extends ContextTest {
typeNode.put(CKANPackage.EXTRAS_VALUE_KEY, EXTRAS_TYPE_VALUE_VALUE);
extraArrayNode.add(typeNode);
/*
ObjectNode modelNode = mapper.createObjectNode();
modelNode.put(CKANPackage.EXTRAS_KEY_KEY, "test");
modelNode.put(CKANPackage.EXTRAS_VALUE_KEY, "test 2.9°");
extraArrayNode.add(modelNode);
*/
ObjectNode populationNode = mapper.createObjectNode();
populationNode.put(CKANPackage.EXTRAS_KEY_KEY, "Population");