Skip to content

Commit

Permalink
Merge pull request #459 from DMTF/Navigation-Property-Check
Browse files Browse the repository at this point in the history
Added check to ensure a reference object is an object prior to attempting to extract the link information
  • Loading branch information
mraineri authored Mar 4, 2022
2 parents 60277a4 + a7b5853 commit 354a9b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions validateResource.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,12 @@ def validateURITree(service, URI, uriName, expectedType=None, expectedJson=None,
continue

# get Uri or @odata.id
if not isinstance(link.Value, dict):
errmsg = '{} is expected to be an object containing @odata.id'.format(link.Name)
my_logger.error(errmsg)
results[uriName]['errors'] += '\n' + errmsg
counts['errorInvalidReferenceObject'] += 1
continue
link_destination = link.Value.get('@odata.id', link.Value.get('Uri'))

if link.Type.Excerpt:
Expand Down

0 comments on commit 354a9b3

Please sign in to comment.