Closed cyberfox1 closed 6 years ago
Thanks for reporting this, @cyberfox1 . We ran into this issue in the stix-elevator. validate_string
doesn't return a list of FileValidationResults
objects, like print_results
expects (instead, it returns ObjectValidationResults
).
Our workaround in the stix-elevator was to wrap the ObjectValidationResults
in a list of FileValidationResults
before calling print_results
.
Short-term, we should update the documentation to remove this invalid example. Longer-term, we need to update print_results
to handle other types of input, or create other functions to accomplish the same thing.
Thanks again!
Produces:
File "lib/python3.6/site-packages/stix2validator/output.py", line 152, in print_results for file_result in sorted(results, key=operator.attrgetter("filepath")): TypeError: 'ObjectValidationResults' object is not iterable
Using:
stix2-validator==1.0.1 Python 3.6.3