spdx-spec icon indicating copy to clipboard operation
spdx-spec copied to clipboard

Possible bug/typo in JSON schema for file.licenseInfoInFile(s)

Open puerco opened this issue 2 years ago • 1 comments

While checking a bug in an implementation I think I found a bug in the JSON schema which may be already widespread.

The License information in file field in the spec is specified as LicenseInfoInFile in tag/value and licenseInfoInFile in its RDF equivalent. Note that the label is singular which matches its purpose (license info in the one file being described).

However, in the latest JSON schema, the same field is in plural licenseInfoInFiles :disappointed:

https://github.com/spdx/spdx-spec/blob/386ce342a28f12d31b77a549261857eda16f9304/schemas/spdx-schema.json#L561C8-L568

I think it may be a copy from the similar named field in Package.

Should we leave it like this? I'm afraid that trying to fix it will break a bunch of implementations but on the other hand, it feels wrong.

/cc @goneall

puerco avatar Mar 14 '23 01:03 puerco

@puerco - The JSON schema does create plurals for any lists or collections for the property name. This is machine generated, and in this case done incorrectly.

I think we leave it as is. Even though it is grammatically incorrect, as you mentioned there are a lot of JSON files out there and this is a very common property name.

We should fix this in 3.0, however.

goneall avatar Mar 14 '23 01:03 goneall

This is resolved in 3.0 - we agreed that all property names will be singular

goneall avatar Apr 04 '24 22:04 goneall