Published OData service doesnt include mandatory <metadata:inline> tag for empty $expand-ed relations
When I request an entity via OData, like http://localhost:8080/odata/Company_Odata_Export/v1/Companies?$expand=Subsidiary when a Company contains a Subsidiary, it is correctly represented something as: <link title="Subsidiary" href="Companies(123456789)/Subsidiary"><m:inline>...Subsidiary data comes here</m:inline></link> However, if the Subsidiary relation is empty, then the odata response only contains: <link title="Subsidiary" href="Companies(987654312)/Subsidiary" /> This causes the OData client (PowerBI e.g.) to query the empty relation, and when the relation is frequently empty the Company query in the example becomes unacceptably slow. I think this is due to the fact that Mendix published OData service doesn’t follow the OData specification, which says: If NavigationProperty represents an EntityType instance and that instance is null, an empty m:inline element MUST appear under the atom:link element that represents NavigationProperty. (https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-odata/39154d30-1af2-4393-b5cb-84699bd60fdf) – With different wording this part is present in all versions of OData:Atom specifications. So it should look like this as per the specs: <link title="Subsidiary" href="Companies(987654312)/Subsidiary"><m:inline /></link> Has someone found any workaround for this?
If you are sure this should be the behaviour in Odata v3, file a ticket to mendix support so it can be fixed in a future release :)