You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@discriminator("kind")
model Pet {
kind: string;
name: string;
weight?: float32;
}
model Cat extends Pet {
kind: "cat";
meow: int32;
}
model Dog extends Pet {
kind: "dog";
bark: string;
}
op read(): { @body body: Cat };
The Dog subtype is not referenced by any operation, sdkPackage is not returning this subtype
however, inside the Pet's model definition, it still has Dog's type being referred in the discriminatedSubtypes.
which is confusing to me, if we generate the serializer/deserializer for Pet, we will have to a Dog serializer for it as it's polymorphic base and the discriminator value has a dog in it. but Dog's definition is missing.
I think we could have two possible solutions for it. Depends on how we want to interpret this.
delete the Dog subtype from Pet's discriminated subtypes.
Describe the bug
In the following typespec,
The Dog subtype is not referenced by any operation, sdkPackage is not returning this subtype
however, inside the Pet's model definition, it still has Dog's type being referred in the discriminatedSubtypes.
which is confusing to me, if we generate the serializer/deserializer for Pet, we will have to a Dog serializer for it as it's polymorphic base and the discriminator value has a dog in it. but Dog's definition is missing.
I think we could have two possible solutions for it. Depends on how we want to interpret this.
Reproduction
N/A
Checklist
The text was updated successfully, but these errors were encountered: