Closed davidmoten closed 3 years ago
An example from Graph beta metadata that should be supported but is not currently:
<Singleton Name="auditLogs" Type="microsoft.graph.auditLogRoot"/>
<EntityType Name="auditLogRoot">
<NavigationProperty Name="directoryAudits" Type="Collection(graph.directoryAudit)" ContainsTarget="true"/>
<NavigationProperty Name="directoryProvisioning" Type="Collection(graph.provisioningObjectSummary)" ContainsTarget="true"/>
<NavigationProperty Name="provisioning" Type="Collection(graph.provisioningObjectSummary)" ContainsTarget="true"/>
<NavigationProperty Name="restrictedSignIns" Type="Collection(graph.restrictedSignIn)" ContainsTarget="true"/>
<NavigationProperty Name="signIns" Type="Collection(graph.signIn)" ContainsTarget="true"/>
</EntityType>
A short look at the use suggests that entities without keys are only being used by Singletons. Might be useful to simplify the problem but we'll see.
Fixed in PR #134, released now in 0.1.53
At the moment odata-client ignores with a warning or fails (configurable) if it encounters an Entity without a Key (inherited or otherwise). In fact this is sometimes legal as per spec:
An example of this is from Dynamics CRM v9.1 metadata:
Neither expando nor crmbaseentity have a key but this is probably legal as there is no reference to expando anywhere else in the document (of course this prompts a question as to its usefulness).
This appears to be very unusual in OData services so this can be considered a low priority task.