Closed msporny closed 3 years ago
Another option is to drop the "did" part and just use existing extensions for the high level serialization encoding: .json
, .jsonld
, .cbor
. There are trade offs of course.
Pros:
.json
, .yaml
, .xml
, etc files everyone deals with and it works..xml
, .ttl
, or .yaml
without any complex registration of .didXXX
.Cons:
Are there use cases that require special .didXXX
extensions?
Are there use cases that require special .didXXX extensions?
"Yes, double-click to open using pre-registered media type handler in operating system." -- requires 1-to-1 mapping in most operating systems.
Note: systems can still choose to store as .cbor / .json / .yaml -- and if those systems store the media type beside the file, they'll continue to use the right application to open the file, even w/ a wonky file suffix. We may not want to suggest that to people, though -- it'll probably confuse more than help.
Non-substantive, multiple reviews, changes suggested (but not made, with explanation given), no objections, merging.
As noted in #684, our IANA Mediat Type filename extensions collide. This has been fixed using the only option available to us (that follows the patterns in other Media Type extensions).
I considered the following patterns:
.did
-- this fails because associated file media type information isn't always preserved on copy and a system falling back to the file extension wouldn't be able to determine the file format based on OS MAGIC numbers (byte headers -- JSON and JSON-LD headers are the same)..did.json
,.did.jsonld
, and.did.cbor
-- looks nice, but there isn't a single example of this pattern in/etc/mime.types
and it broke 3 of the 5 media type libraries I tested..djs
,.dld
,.dcb
-- compatible with every known OS and filesystem going back to the 1990s... but too cryptic, people associatejs
with JavaScript, not JSON,dld
isn't accurate, as there will be CBOR-LD, etc..didjson
,.didjsonld
, and.didcbor
-- this seemed to be compatible with every modern operating system and file system. It won't work on filesystems that are more than 20 years old.This PR goes with item 4 above. Marking it as non-substantive since we don't have any normative statements regarding file extensions in the specification.
Preview | Diff