CybOXProject / python-cybox

A Python library for parsing, manipulating, and generating CybOX content.
http://cybox.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
77 stars 42 forks source link

XSI_TYPE in vocabs not serialized due to logical error #313

Closed emmanvg closed 6 years ago

emmanvg commented 6 years ago

https://github.com/CybOXProject/python-cybox/blob/master/cybox/common/vocabs.py#L123
Note the right-hand side of the OR expression will return True if an XSI_TYPE and xsi_type is set making self.is_plain() return True which is False...

emmanvg commented 6 years ago

It affects to_dict() because it makes use of it, but it can also affect the general code logic when used outside.

gtback commented 6 years ago

Can we add a test that demonstrates this? I remember why we made is_plain(), but I don't really understand the implications of this change.