Skip to content

version resilient model could not handle nested discriminators #2036

@tadelesh

Description

@tadelesh

For current cadl-ranch test case: https://github.com/Azure/cadl-ranch/blob/main/packages/cadl-ranch-specs/http/type/model/inheritance/nested-discriminator/main.tsp, the deserialization for the nested discriminator will be wrong.
For example, when we call test.partner.sharktype, we will get error.

test = Salmon(
{
        "age": 1,
        "kind": "salmon",
        "partner": {
            "age": 2,
            "kind": "shark",
            "sharktype": "saw",
        }
})

Metadata

Metadata

Assignees

Labels

bugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions