Skip to content

feat: generate json-schema for -o json#3269

Open
axel7083 wants to merge 1 commit intoanchore:mainfrom
axel7083:feature/generate-json-schema-json-output
Open

feat: generate json-schema for -o json#3269
axel7083 wants to merge 1 commit intoanchore:mainfrom
axel7083:feature/generate-json-schema-json-output

Conversation

@axel7083
Copy link

@axel7083 axel7083 commented Mar 6, 2026

Fixes #214

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
)

const (
DocumentSchemaVersion = "1.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should definitely not be 1.0

Copy link
Author

@axel7083 axel7083 Mar 6, 2026

Choose a reason for hiding this comment

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

As this seems for the other json-schemas to be unrelated to the version of grype, and seems to increase when the schema changes, what would be the expected initial value?

E.g. version for the dbsearch schema

MatchesSchemaVersion = "1.1.3"

"$id": "anchore.io/schema/grype/db-search/json/1.1.3/matches",

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I started typing something else up and got sidetracked... we are definitely going to be iterating on this model as we work towards 1.0. We will probably what we did with Syft and have a legacy schema for pre-1.0 Grype, essentially the one that we have today. It's a great question what that number should be! I would think 0.9 indicates it's close to 1.0, but I think it is going to change significantly (e.g. possibly have matches only with references to packages and vulns). Maybe a 0.5 is something that indicates "significantly before 1.0". I'll bring this question to the team...

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the details, keep me updated so I can update the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add json schema

2 participants