Per yaml page https://yaml.org/faq.html they recommend .yaml as file extension but I see drupal uses almost exclusively .yml, how so? And does adding .yaml to file extension even work for drupal 8 or will it be skipped?

  • 1
    Probably because of Symfony - they didn't support the .yaml extension until later on (see github.com/symfony/symfony/commit/…). I'd imagine Drupal just went along with what was available at the time. Incidentally: no, the .yaml extension doesn't work with Drupal as of 8.6.5
    – Clive
    Jan 14, 2019 at 10:31

2 Answers 2


Drupal uses '.yml' because Symfony uses '.yml'

This was discussed in https://www.drupal.org/project/drupal/issues/2091669

I am assuming that '.yaml' would not work, but I haven't tried it. For consistency reasons it is best to stick to '.yml'.

EDIT: Looks like Symfony has started recommending '.yaml' from version 4.0. Can be seen by comparing this page https://symfony.com/doc/4.0/routing.html with the 3.4 version

  • 1
    I remember now I got one occasion where I used .yaml and d8 module didnt work. I was surprised as my code editor was enforcing .yaml as extension and I didnt think it would matter, but it did.
    – Blissful
    Jan 14, 2019 at 11:00

because drupal 8 based on symfony 2 and .yaml is not recomended in symfony 2 , it's recomended just for version 4 of symfony 4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.