Skip to content

Conversation

carmenbianca
Copy link
Member

No description provided.

Copy link

@BaumiCoder BaumiCoder left a comment

Choose a reason for hiding this comment

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

I tested the schema with the Taplo extension in VSCodium:

  • ✔️ Hints for key value pairs work
  • ✔️ Typing [[ only suggest [[annotations]]
  • ✔️ An empty [[annotations]] table shows the error message that path is required
  • ⚠️ Typing [ suggests [SPDX-PrimaryPackagePurpose], which seems to be wrong. I have no idea, where this strange suggestion is coming from.
  • ⚠️ The suggestions have some duplications. Inside the [[annotations]] table:
Suggestions in annotations

and outside:
Suggestions

I don't know where this coming from or if that is maybe a bug in Taplo and not in the schema.

You can use this configuration in a .taplo.toml file to test the schema:

[[rule]]
include = ["**/REUSE.toml"]

[rule.schema]
path = "https://raw.githubusercontent.com/carmenbianca/reuse-website/refs/heads/tomlschema/site/static/reuse-toml-v1.schema.json"

(After merge and deploying this PR the path value should be https://reuse.software/reuse-toml-v1.schema.json)

The specification explicitly does not define the semantics of other
keys, so we shouldn't define them here. Especially with autocomplete,
and also by adding type restrictions, including these keys might give
the impression that they are semantically significant somehow.
@carmenbianca
Copy link
Member Author

Hi @BaumiCoder, thanks for the review!

  • Seeing the massive list of SPDX tag autocomplete suggestions, and re-reading the REUSE specification which says that keys which aren't included in the spec have no defined semantics, I decided to strip out the SPDX tags. They're not 'properly' part of REUSE, so including them seemed not entirely right.
  • I added a link to the specification which first defined REUSE.toml in the $comment field. That's version 3.2, even as the spec is currently at version 3.3. This is probably fine, because the definition for REUSE.toml hasn't changed between those releases. Adding a link that always points to the latest version of the spec seemed wrong to me.
  • I think I know what's up with the autocomplete. I've not thoroughly researched this, but it seems like all the properties which can have multiple valid types are duplicated. I don't know what to do about this.

Copy link

@BaumiCoder BaumiCoder left a comment

Choose a reason for hiding this comment

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

Okay, maybe without the SPDX tags it is more correct in respect of the current specification. The duplicated suggestion seems to be really related to the types. When pressing Ctrl + Space to get the suggestion, I tried both path options inside a [[annotations]]. One gives a path = "" and the other one gives path = []. So, one for every type.

Thank you, for your effort.

@kbroch-rivosinc
Copy link

I ran the schema through a tool https://github.com/sourcemeta/jsonschema to lint it (which I often do as I'm always learning new things about json schemas). Here are the suggestions from it:

[email protected]:~/work/reuse-website on  tomlschema via 🐍 v3.13.6
❯ jsonschema --version
11.8.1

[email protected]:~/work/reuse-website on  tomlschema [?] via 🐍 v3.13.6
❯ jsonschema lint site/static/reuse-toml-v1.schema.json
site/static/reuse-toml-v1.schema.json:9:27:
  Setting the `additionalProperties` keyword to the true schema does not add any further constraint (additional_properties_default)
    at schema location "/additionalProperties"
site/static/reuse-toml-v1.schema.json:24:33:
  Setting the `additionalProperties` keyword to the true schema does not add any further constraint (additional_properties_default)
    at schema location "/properties/annotations/items/additionalProperties"

https://json-schema.org/understanding-json-schema/reference/object#additionalproperties

Hope this helps.

It is superfluous. sourcemeta-jsonschema's linter complains about its
usage.
Comment on lines +313 to +314
<https://reuse.software/reuse-toml-v1.schema.json>. This Specification remains
authoritative.
Copy link
Member Author

@carmenbianca carmenbianca Sep 25, 2025

Choose a reason for hiding this comment

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

This Specification → The REUSE specification

Copy link
Member Author

Choose a reason for hiding this comment

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

Or: [...] is provided at [...] for your convenience.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://reuse.software/reuse-toml-v1.schema.json",
"$comment": "See https://reuse.software/spec-3.2/ for details",
Copy link
Member Author

Choose a reason for hiding this comment

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

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