Discovery.xml fallback from view to edit?

In discovery.xml, most extensions and MIME types have either a “view” operation or an “edit” or a “view_comment” operation.

In practice, most file types which have an “edit” or “view_comment” operation in discovery.xml can also be opened as readonly (view, preview).

This means when evaluating whether a file can be viewed (as read-only), and which url to use, we also have to look up the edit and view_comment operation.

Problems:

  1. I did not find this documented anywhere.
  2. It is not clear to me whether this is true for all file types. Perhaps there are some types where Collabora does not have a read-only mode?

Btw I was going to open this is in github, but I was not sure whether it is a feature or bug report or something else.