You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A likely solution would be to check for such objects in to_dict() of cybox.Entity and if found, cast them to a string before passing them into the dictionary. This is essentially what python-stix does in its to_dict() methods.
I don't know if we want to convert it to a string in to_dict or to_json. For DateTimeObjectPropertys, to_dict already returns a string (I don't know if that's ideal or not). If we want to leave it as a datetime in the dictionary representation, we can write a custom JSON Encoder for this, and use this in our to_json function.
Activity
gtback commentedon Feb 26, 2015
I don't know if we want to convert it to a string in
to_dictorto_json. ForDateTimeObjectPropertys,to_dictalready returns a string (I don't know if that's ideal or not). If we want to leave it as a datetime in the dictionary representation, we can write a custom JSON Encoder for this, and use this in ourto_jsonfunction.