Commented code which add non mandatory field as empty field if there are
no mandatory fields
This commit is contained in:
parent
51b76c89e6
commit
eb8e0b7bea
|
@ -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;
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue