CycloneDX/sbom-utility

Enhancement: Summarize "duplicate components" schema error

開放

#37 建立於 2023年6月8日

 (5 則留言) (0 個反應) (0 位負責人)Go (20 個分叉)auto 404
enhancementhelp wanted

倉庫指標

星標
 (155 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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.

貢獻者指南