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

Expected media type for spdx json/xml documents #577

Open
sambhav opened this issue Sep 24, 2021 · 8 comments
Open

Expected media type for spdx json/xml documents #577

sambhav opened this issue Sep 24, 2021 · 8 comments
Labels
serialization Something about the representation of data in bytes

Comments

@sambhav
Copy link

sambhav commented Sep 24, 2021

Hello SPDX team. We are trying to integrate spdx support in buildpacks. One of the things that we had a question about was the appropriate media type for spdx documents. It looks like the IANA media type for spdx is registered as text/spdx. Looking at the entry document this seems to be specifically for the spdx tag format. https://www.iana.org/assignments/media-types/text/spdx What is the expected media type for json/xml spdx documents?

text/spdx+json or text/spdx+xml based on https://en.wikipedia.org/wiki/Media_type#Suffix Or would all of them be text/spdx?

Wondering as we were looking at some other sbom formats on the list

CycloneDX seems to have

application/vnd.cyclonedx+json and application/vnd.cyclonedx+xml respectively.
. Swid seems to have application/swid+xml

Any guidance here would be greatly appreciated.

@sambhav
Copy link
Author

sambhav commented Sep 24, 2021

cc: @nishakm maybe you can help?

@nishakm
Copy link
Contributor

nishakm commented Sep 24, 2021

@rnjudge Applied on behalf of SPDX. We could also apply for something like application/org.spdx+json. It's something we can bring up in the next SPDX tech meeting.

@rnjudge
Copy link
Contributor

rnjudge commented Sep 24, 2021

@samj1912 Yes, the current IANA SPDX type was intended to represent tag-value format with the intention being to re-visit adding other formats in the future so I suppose the future is upon us :) Definitely worth raising at the next meeting and I would be happy to lead this effort. Thanks for surfacing this.

@rnjudge
Copy link
Contributor

rnjudge commented Oct 4, 2021

Hi @samj1912 - just wanted to update you that I will open an application to add SPDX JSON/XML IANA media types this week.

@rnjudge
Copy link
Contributor

rnjudge commented Nov 3, 2021

The application/spdx+json media type is officially approved and recorded with IANA: https://www.iana.org/assignments/media-types/application/spdx+json.

After discussing with a few SPDX folks, it was determined that the XML schema needs further review before officially submitting to IANA. I am having conversations around this now and will try to report back with an estimated time frame for when we can expect this.

@nishakm
Copy link
Contributor

nishakm commented Nov 4, 2021

This is excellent news! Thanks @rnjudge for pushing this through!
cc: @SteveLasker for OCI mediaTypes

@kestewart
Copy link
Contributor

Rose discussed: Only missing media type is now XML. Need to get follow up for @zvr for review.

@goneall goneall added this to the no-release milestone Aug 11, 2022
@bact bact added the serialization Something about the representation of data in bytes label Sep 26, 2024
@bact
Copy link
Collaborator

bact commented Sep 26, 2024

Media type information page on IANA also has a field about file extension.
The tag:value SPDX text file has an extension of ".spdx" in IANA.

For JSON, in SPDX 2.3 spec it suggests ".spdx.json"
https://spdx.github.io/spdx-spec/v2.3/conformance/#44-standard-data-format-requirements
-- which is the same as specified in https://www.iana.org/assignments/media-types/application/spdx+json

For SPDX 3, there's no suggested file extension in the spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
serialization Something about the representation of data in bytes
Projects
None yet
Development

No branches or pull requests

6 participants