Closed eduard-tita closed 1 year ago
@eduard-tita I agree the example looks valid. This looks like an issue with the deserialization code.
Rather than throwing an exception here, it should handle a single relationship.
@eduard-tita I agree the example looks valid. This looks like an issue with the deserialization code.
Rather than throwing an exception here, it should handle a single relationship.
Thanks, @goneall. Something that's still a bit puzzling for me is that the same SPDX sample (i.e. single relationship) in JSON format works fine.
Something that's still a bit puzzling for me is that the same SPDX sample (i.e. single relationship) in JSON format works fine.
I'm not completely sure myself, but I believe it relates to how the Jackson libraries handle XML elements when deserializing. It is trying to map XML elements into either an array or a single object. In JSON, the syntax makes it clear it is an array while in XML it is ambiguous without the schema. This is a potential issue with other expected arrays where in XML it is represented by a single element.
@goneall Is it possible to do a release that contains the above fix? Thanks
@eduard-tita - Will do - I'm a bit overcommitted with other tasks this week, but I should be able to spin a release this weekend or early next week.
@eduard-tita - Just did a new release - 1.1.7 - with this fix.
I have not done a new release of any of the utilities that use this library (e.g. tools-java) - let me know if I should spin a new release for those. Otherwise, I'll wait for additional fixes.
Thanks a lot, @goneall. This will do for now.
I'm having trouble deserializing SPDX 2.3 XML files that contain a single relationship. I always get an exception like:
Here's a code fragment that can be used to replicate the issue:
Is there anything I have to add/change to make it work? If I add another relationship element to the above, everything works fine. As far as I can tell the sample XML above is valid as per SPDX spec ver. 2.3.
Thank you.