Skip to content

Enhance polymorphic deserialization to handle multi-level inheritance #2432

@darrelmiller

Description

@darrelmiller

Currently the deserializer cannot instantiate types that are not direct descendants of the declared return type. Instead it will default to the base type.

This was a performance compromise because in Microsoft Graph all types derive from a base type "entity" and if any operation returned an entity it would be expensive to search the entire tree of types looking for the correct type.

One solution to consider in the future is to create a global mapping table that is aware that Graph has globally unique discriminators so that it can reduce the duplication of mapping tables. We would then move the type mappings for the types into request builders and property deserializers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Triage 🔍enhancementNew feature or requestgeneratorIssues or improvements relater to generation capabilities.

    Type

    No type

    Projects

    Status

    New📃

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions