Skip to content

chore: add schema id#10969

Open
Vessel9817 wants to merge 3 commits into
aquasecurity:mainfrom
Vessel9817:patch-1
Open

chore: add schema id#10969
Vessel9817 wants to merge 3 commits into
aquasecurity:mainfrom
Vessel9817:patch-1

Conversation

@Vessel9817

Copy link
Copy Markdown

Description

Following the addition to SchemaStore via SchemaStore/schemastore#5986, the Trivy config schema should have a unique ID. From the draft-2020-12 spec:

Note that this URI is an identifier and not necessarily a network locator. In the case of a network-addressable URL, a schema need not be downloadable from its canonical URI.

If present, the value for this keyword MUST be a string, and MUST represent a valid URI-reference [RFC3986]. This URI-reference SHOULD be normalized, and MUST resolve to an absolute-URI [RFC3986] (without a fragment), or to a URI with an empty fragment.

The provided ID is one such example of a URI following this spec. If, for whatever reason, SchemaStore/schemastore#5986 isn't merged, the ID can be changed to, for instance, https://raw.githubusercontent.com/aquasecurity/trivy/main/schema/trivy-config.json. Although the spec dictates that the schema need not be downloadable from its ID, this quality does avoid confusion.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@CLAassistant

CLAassistant commented Jul 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread schema/trivy-config.json
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://www.schemastore.org/trivy-config.json",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generate this file using generateConfigSchema() (in mage package).
You need to update this function.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this PR hasn't been merged yet, I think we can wait a bit.
If they don't merge it, we'll change the URL to https://raw.githubusercontent.com/aquasecurity/trivy/main/schema/trivy-config.json.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just been merged, should be up on the website later

Comment thread schema/trivy-config.json
This reverts commit f46418e.
Signed-off-by: Vessel9817 <151808241+Vessel9817@users.noreply.github.com>
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.

3 participants