sbom-utility icon indicating copy to clipboard operation
sbom-utility copied to clipboard

Enhancement: Summarize "duplicate components" schema error

Open mrutkows opened this issue 1 year ago • 5 comments

Extracted this feature request from issue https://github.com/CycloneDX/sbom-utility/issues/35

I ran this on an SBOM with 9928 components. There were duplicate components.

	1. Type: [unique], Field: [components], Description: [array items[3,243] must be unique] 
	Failing object: [[
	  {
	    "name": "acl",
	    "publisher": "Guillem Jover <guillem@ ... (truncated)

The message is correct, components[3] and components[243] were duplicates. However, the "failing object" is truncated to show components[0]. But it wasn't related to the message. It would be much easier to read the message if the message showed components[3] instead of components[0].

Look to create special "handlers" for common error types starting with "duplicates". For example, the handler could actually identify and extract the "duplicate" object (the first one) and then better format the error message to show the entire json object.

mrutkows avatar Jun 08 '23 13:06 mrutkows