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" : ""}.
|
// 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.
|
// Sometimes it is important to view the field as empty.
|
||||||
|
/*
|
||||||
if(fieldsFoundWithThisKey == 0 && !metadataField.getMandatory()) {
|
if(fieldsFoundWithThisKey == 0 && !metadataField.getMandatory()) {
|
||||||
toReturn.add(new CustomField(metadataFieldName, "", -1, -1));
|
toReturn.add(new CustomField(metadataFieldName, "", -1, -1));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return toReturn;
|
return toReturn;
|
||||||
|
|
||||||
|
|
|
@ -307,10 +307,12 @@ public class CKANPackageTest extends ContextTest {
|
||||||
typeNode.put(CKANPackage.EXTRAS_VALUE_KEY, EXTRAS_TYPE_VALUE_VALUE);
|
typeNode.put(CKANPackage.EXTRAS_VALUE_KEY, EXTRAS_TYPE_VALUE_VALUE);
|
||||||
extraArrayNode.add(typeNode);
|
extraArrayNode.add(typeNode);
|
||||||
|
|
||||||
|
/*
|
||||||
ObjectNode modelNode = mapper.createObjectNode();
|
ObjectNode modelNode = mapper.createObjectNode();
|
||||||
modelNode.put(CKANPackage.EXTRAS_KEY_KEY, "test");
|
modelNode.put(CKANPackage.EXTRAS_KEY_KEY, "test");
|
||||||
modelNode.put(CKANPackage.EXTRAS_VALUE_KEY, "test 2.9°");
|
modelNode.put(CKANPackage.EXTRAS_VALUE_KEY, "test 2.9°");
|
||||||
extraArrayNode.add(modelNode);
|
extraArrayNode.add(modelNode);
|
||||||
|
*/
|
||||||
|
|
||||||
ObjectNode populationNode = mapper.createObjectNode();
|
ObjectNode populationNode = mapper.createObjectNode();
|
||||||
populationNode.put(CKANPackage.EXTRAS_KEY_KEY, "Population");
|
populationNode.put(CKANPackage.EXTRAS_KEY_KEY, "Population");
|
||||||
|
|
Loading…
Reference in New Issue