Skip to content

[Feature] Retrieve complex properties of derived types  #437

@irvinesunday

Description

@irvinesunday

We need to generate complex properties of derived types (besides the navigation properties as we currently do).

We'll need to update this code block to achieve this:

if (convertSettings.ExpandDerivedTypesNavigationProperties)
{
if (annotable is IEdmNavigationProperty navigationProperty && !navigationProperty.ContainsTarget)
{
continue;
}
foreach (var declaredNavigationProperty in targetType.NavigationProperties())
{
RetrieveNavigationPropertyPaths(declaredNavigationProperty, null, castPath, convertSettings);
}
}

to something like...

if (convertSettings.ExpandDerivedTypesNavigationProperties)
{
    if (annotable is IEdmNavigationProperty navigationProperty && !navigationProperty.ContainsTarget)
    {
        continue;
    }

    foreach (var declaredNavigationProperty in targetType.NavigationProperties())
    {
        RetrieveNavigationPropertyPaths(declaredNavigationProperty, null, castPath, convertSettings);
    }
    
    if (targetType is IEdmEntityType entityType)
    {
        RetrieveComplexPropertyPaths(entityType, castPath, convertSettings);
    }                                                
}

Thoughts: Should we add a new convert setting named RetrieveDerivedTypesProperties and deprecate ExpandDerivedTypesNavigationProperties. This will account for retrieving both complex and navigation properties of derived types.

Related to: microsoftgraph/msgraph-metadata#465 (this feature is required for the mentioned issue to be achieved)

Metadata

Metadata

Assignees

Labels

priority:p0Blocking issue/ loss of critical functions. An ICM may be filed to communicate urgency. SLA<=48hrstype:feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions