Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow $schema entry in SPDX 2.3 JSON #865

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

mcombuechen
Copy link

This adds an allowed field $schema to the JSON schema, which can be used to reference the SPDX 2.3 JSON schema.
Ideally this would be an enum with a list of allowed locators, but since the schema is not hosted anywhere other than in GitHub (not to my knowledge), I left it as a free-form string.

Closes #864.

@mcombuechen mcombuechen force-pushed the feat/spdx-json-schema branch 3 times, most recently from 72eb68b to eee106c Compare October 17, 2023 09:10
Closes spdx#864.

Signed-off-by: Maximilian Combüchen <[email protected]>
Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

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

Thanks @mcombuechen - looks good to me.

@zvr - could you give this a second review?

@zvr
Copy link
Member

zvr commented Oct 17, 2023

Since the JSON schema is automatically generated, shouldn't the change be done in https://github.com/spdx/tools-java/blob/master/src/main/java/org/spdx/tools/schema/OwlToJsonSchema.java ?

@mcombuechen
Copy link
Author

Thanks @zvr and @goneall , I was not aware of the auto-generation. Will look into adding the change there.

@mcombuechen
Copy link
Author

However, it seems that latest changes to the file have been made without changes elsewhere; suggesting that it's not auto-generated and maintained manually? https://github.com/spdx/spdx-spec/commits/development/v2.3.1/schemas/spdx-schema.json

Or am I getting this wrong?

@goneall
Copy link
Member

goneall commented Oct 17, 2023

Since the JSON schema is automatically generated, shouldn't the change be done in https://github.com/spdx/tools-java/blob/master/src/main/java/org/spdx/tools/schema/OwlToJsonSchema.java ?

Thanks @zvr for catching this.

We have generated the spec in the past, but the last few commits were merged in manually. Once the 3.0 spec is released, we'll go back to automatically generating the schema.

At the same time, we should update the utility to generate the correct schema in case we want to do another dot release of the spec.

I added spdx/tools-java#144 to track the tools update.

@zvr - we can probably merge this in if you're OK with the schema change.

@mcombuechen
Copy link
Author

@zvr could you have another look? 🙏

@goneall
Copy link
Member

goneall commented Nov 1, 2023

Hmm. It looks like the CI is failing due to some dependency update issues unrelated to this PR.

I'll go head and merge this and add an issue to look into the CI failures.

@goneall goneall merged commit 8a59502 into spdx:development/v2.3.1 Nov 1, 2023
1 of 2 checks passed
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.

Attribute $schema not allowed within JSON schema
3 participants