Git Product home page Git Product logo

Comments (6)

dougwilson avatar dougwilson commented on September 22, 2024

Whatever the specification says the extension is for that mime type, we will add. There is no specific rule unless the IANA has some kind of restrictions. I hope that helps.

from mime-db.

jdesrosiers avatar jdesrosiers commented on September 22, 2024

Thanks

from mime-db.

dougwilson avatar dougwilson commented on September 22, 2024

Basically we don't have any specific rules, as we don't make them :) we simply aggregate the data from the three sources listed at the top of the readme.

from mime-db.

Martii avatar Martii commented on September 22, 2024

@jdesrosiers
While I didn't find much with a quick skim of rfc's at IETF... did find rfc2045, rfc2046, rfc2047, rfc2048, and rfc4288 (naming requirements). Having the right industry buzz, canonical lexical grammar, names is usually a key for finding information. More skimming/reading is up to you. 😸

If I were to take an educated guess it would probably be US-ASCII 7-bit and extensions to those standards with encoding using special sequences of ASCII characters that may not normally be allowed. So the period does fall within 0-127 decimal but also could be restrictive somewhere else in some other use case. Interoperability is usually what is aimed for between platforms as well as recognition.

Final resort is to try registering it and they'll tell you if it's okay or not.

from mime-db.

jdesrosiers avatar jdesrosiers commented on September 22, 2024

Thanks, I did some similar reading before asking the question and came up with nothing as well. I was hoping to get this added to the custom-types.json list. My understanding is that that's the place types can be defined that aren't part of the three sources you pull from. YAML, for example, isn't on any of those lists. Do I understand correctly that JSON Schema could be added in this way as well? In those cases, I figured you might have some rules that you follow about what you accept that isn't registered by some official standards body, which is why I asked here.

Despite application/schema+json being in use for over a decade, I don't think it's likely to be registered with IANA any time soon because we're not affiliated with any standards body, which seems to be a requirement. The schema.json extension has never been in the specification, but it's emerged as a fairly ubiquitous practice. I expect the first step is to get that added to our spec before it could be accepted here.

from mime-db.

dougwilson avatar dougwilson commented on September 22, 2024

As far as the custom-types, in the ideal world we wouldn't need it, but I acknowledge that there are various things that should be included in the database that are not a part of our sources. Really, as I do not desire to be a registry or debate assignments, the only "rule" is that there should be a primary source that links the file extension to the media type. The best source is some kind of specification. I found https://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.14.1 which I would gather is the spec for it; no file extension is currently listed there, though.

As far as allowed characters, since this is not a registry, and the extension are just strings, it could in theory contain any chars. Now, if those char make sense to consumer of this module, I don't know, haha. Or file systems, etc. I do know that many folks use the extensions in combination with https://nodejs.org/dist/latest-v16.x/docs/api/path.html#path_path_extname_path so I would guess that given a file name foo.schema.json most things will be unable yo figure out the "correct" media type from the name.

from mime-db.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.