CycloneDX/sbom-utility

Enhancement: Summarize "duplicate components" schema error

Offen

#37 geöffnet am 08.06.2023

 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (20 Forks)auto 404
enhancementhelp wanted

Repository-Metriken

Stars
 (155 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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.

Contributor Guide