Wot-thing-description: TD File Extension Convention

Created on 11 Aug 2021  路  3Comments  路  Source: w3c/wot-thing-description

I had thought that we agreed at some point that the file extension for TDs should be td.jsonld or td.json. However, it seems that the IANA registration used .jsontd (https://www.iana.org/assignments/media-types/application/td+json) that now even Firefox downloads a TD with .jsontd extension. Should we change this convention we agreed or change IANA registration somehow and hope that it is not too late?

Most helpful comment

I don't know how much an effort is to change the IANA registration, but I want to stress that having td.json and td.jsonld as extensions would allow IDEs and browsers to fallback to JSON if they don't support td types. It is also al well establish a pattern in the Nodejs community and not only there.

All 3 comments

I don't know how much an effort is to change the IANA registration, but I want to stress that having td.json and td.jsonld as extensions would allow IDEs and browsers to fallback to JSON if they don't support td types. It is also al well establish a pattern in the Nodejs community and not only there.

As a data point, a similar W3C specification I've worked on, Web App Manifest (application/manifest+json) has a file extension of .webmanifest, but the specification says in a note that .json is also fine. In my experience the vast majority of developers use .json.

In that case the important point from the point of view of implementations is the rel=manifest link relation type which is used to discover manifests, and the MIME type is seen as more important than the file extension (which can also be omitted entirely).

I don't have a strong opinion about whether to try to change the IANA registration for Thing Descriptions, but if that turns out to be difficult one option would be to add a note to the TD specification to say that a .json file extension is also acceptable. The most important point is probably that the WoT Discovery specification doesn't depend on the file extension for discovery.

I agree that for developer tools having a .json file extension would be convenient as more tools will know how to handle the file.

Thanks for the comments @relu91 and @benfrancis . I think that the minimum we need to do is to explain that as a note regarding what is registered in IANA and what we propose. Ideally, we should change IANA registration since changing it in various clients that can download a TD is probably equally/more difficult and technically wrong.

On the other hand, I have looked at other + using MIME types at IANA and they either use just .json or .xml or define something new like we had done at the time with .jsontd. Could it be that a two-dotted file extension is not acceptable by IANA?

My opinion is to also use .td.json

Was this page helpful?
0 / 5 - 0 ratings