Discovery.xml lookup: extension or MIME type?

The discovery.xml has one section with file extensions, and another (“legacy”) section with MIME types.

I think for a lookup what to do with a given file, the extension part should always be checked first, is that correct?

This is also what we see in Microsoft WOPI documentation, WOPI discovery | Microsoft Learn

I am asking just to be sure, and because I think it needs to be explained in more detail in the documentation.