Merge pull request #10 from RESOStandards/eric/9

Issue#9 - moved field name and type checks, continue on null
This commit is contained in:
Eric Finlay 2020-04-02 08:39:44 -07:00 committed by GitHub
commit 8f1179cf2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 -> {