Issue#9 - moved field name and type checks, continue on null expand field value

Signed-off-by: Eric Finlay <eric@rets.ly>
This commit is contained in:
Eric Finlay 2020-04-01 13:28:48 -07:00
parent c32f83e682
commit 6d63ca8692
1 changed files with 5 additions and 4 deletions

View File

@ -891,11 +891,12 @@ public class WebAPIServer_1_0_2 implements En {
if (showResponses) LOG.info("\nRecord #" + counter.getAndIncrement());
clientEntity.getProperties().forEach(clientProperty -> {
assertNotNull("ERROR: field name cannot be null!", clientProperty.getName());
assertNotNull("ERROR: data type could not be found for " + clientProperty.getName() + "! "
+ "\nCheck the NavigationProperty for your $expand field.", clientProperty.getValue().getTypeName());
if (clientProperty.getName().equals(expandField)) {
assertNotNull("ERROR: '" + parameterExpandField + "' contains no data!", clientProperty.getValue());
// There may be nothing to expand, empty or null is a valid result
if (clientProperty.hasNullValue()) return;
assertNotNull("ERROR: data type could not be found for " + clientProperty.getName() + "! "
+ "\nCheck the NavigationProperty for your $expand field.", clientProperty.getValue().getTypeName());
LOG.info("\tExpanded Field Name: " + expandField);
clientProperty.getValue().asComplex().forEach(expandedClientProperty -> {