Skip to content

YAML MIME type is not correct #11

@Omikhleia

Description

@Omikhleia

Greetings,

I'm interested in using this library in a small project, where I'll also need to get the correct MIME type for YAML files.

Observed

> mimetypes = require 'mimetypes'
> mimetypes.guess("file.yml")
text/yml
> mimetypes.guess("file.yaml")
text/yaml

Expected

As of 2025, I would have expected application/yaml.
(BTW. I don't know what text/yml is supposed to be, vs. text.yaml)

Rationale:

Historically, YAML was supposedly referenced as (mostly) application/x-yaml, or (sometimes) as text/yaml or text/x-yaml.

It took more than 22 years for YAML to be recognized, but in early 2024 it was finally officially registered, see RFC9512

  • The official MIME type is application/yaml.
  • Older (used by non-registered) aliases application/x-yaml, text/yaml, and text/x-yaml are deprecated.
  • The RFC states the usual file extensions are yaml (preferred) and yml, see 3.3.
  • (The +yaml suffix is also registered, but that's not relevant for the discussion here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions