Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test cases for the Union for Discriminated types #489

Open
lirenhe opened this issue Jan 5, 2024 · 1 comment
Open

Add test cases for the Union for Discriminated types #489

lirenhe opened this issue Jan 5, 2024 · 1 comment
Assignees

Comments

@lirenhe
Copy link
Contributor

lirenhe commented Jan 5, 2024

Today, there is no cases for Discriminated types in https://github.com/Azure/cadl-ranch/tree/main/packages/cadl-ranch-specs/http/type/model/inheritance

Based on https://microsoft.github.io/typespec/standard-library/discriminated-types, we should add test cases for

@discriminator("kind")
union Pet {
  cat: Cat,
  dog: Dog,
}

model Cat {
  kind: "cat";
  meow: int32;
}

model Dog {
  kind: "dog";
  bark: string;
}
@lirenhe lirenhe assigned lirenhe and ArcturusZhang and unassigned lirenhe Jan 5, 2024
@weidongxu-microsoft

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants