Skip to content

Allow empty statements list in schema#64

Open
TimCares wants to merge 2 commits into
openvex:mainfrom
TimCares:main
Open

Allow empty statements list in schema#64
TimCares wants to merge 2 commits into
openvex:mainfrom
TimCares:main

Conversation

@TimCares

Copy link
Copy Markdown

Hi,

just a quick PR.

Based on the contributing guidelines (namely Section 4.1) I did not create an issue as this PR is a one liner.

I was recently playing around with the OpenVEX format, and implemented it into my public python development template (commit here).

However, I found that when there are no existing CVEs to triage, and the statements field of the spec is empty, it leads to a json validation error because the spec requires at least one statement being present.

Users of this format therefore either have to delete the file, or find some other workaround, as I currently have in my template.

I thought that this was a little cumbersome, as an empty statements fields is also quite expressive: “There are (currently) no CVEs to triage in this project.”

Therefore, I propose a one line fix:

- “minItems": 1,
+ “minItems": 0,

I am aware of the fact that this might break code of other software/libraries consuming the OpenVex format.
However, from what I saw trivy seems to be a main consumer of this format, which is why I checked the source code consuming OpenVex:

Trivy uses the vex go client, which can be seen in the file pkg/vex/openvex.go.

The go client defines this structure for the OpenVex format:

// The VEX type represents a VEX document and all of its contained information.
type VEX struct {
	Metadata
	Statements []Statement `json:"statements"`
}

Link here.

Since this allows an empty statements list, there is also a drift between the schema in the go client and the json schema.

Using a test run of trivy with OpenVex I verified that trivy can indeed handle an empty statements field:

{
  "@context": "https://openvex.dev/ns/v0.2.0",
  "@id": "https://openvex.dev/docs/public/vex-project-template",
  "author": "Project Maintainers",
  "timestamp": "2026-06-15T14:13:08Z",
  "version": 1,
  "statements": []
}
docker run --rm \
  -v "path/to/empty/openvex.json:/vex/openvex.json:ro" \
  ghcr.io/aquasecurity/trivy:0.70.0 image \
  --severity HIGH,CRITICAL \
  --vex /vex/openvex.json \
  --exit-code 0 \
  alpine:3.20

The command runs through.

Therefore, I conclude that at least for Trivy, this change/fix can be deemed safe (however, it might not be safe for all consumers).

TimCares added 2 commits June 19, 2026 22:49
This change fixes an inconsistency with the OpenVex go client, and also leads to better usability
when no CVE has to be triaged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant