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

Should discriminator emit a warning oif property does not exist #2589

Closed
timotheeguerin opened this issue Oct 19, 2023 · 2 comments
Closed
Assignees
Labels
design:needed A design request has been raised that needs a proposal triaged:core

Comments

@timotheeguerin
Copy link
Member

timotheeguerin commented Oct 19, 2023

Could kinda solve this issue too #2583

We didn't use to require the discriminator property on the base type originally because we didn't have property override but now we do it feels like you should describe that property.

//bad
@discriminator("kind") model Pet {}

// good
@discriminator("kind") model Pet { kind: string }
@markcowl
Copy link
Contributor

  • core: require property?
  • azure: suggest enum value for property?

@markcowl markcowl added the design:needed A design request has been raised that needs a proposal label Oct 23, 2023
@markcowl markcowl added this to the Backlog milestone Oct 23, 2023
@markcowl markcowl modified the milestones: Backlog, [2023] December Nov 6, 2023
@timotheeguerin
Copy link
Member Author

Decision create azure-core linting rule that validate discriminator is a union so it would take care of that. And instead investigate issue #2737

@markcowl markcowl changed the title Should @discriminator emit a warning if you don't have the property Add azure.core linter rule if discriminator is not an open union Jan 8, 2024
@markcowl markcowl changed the title Add azure.core linter rule if discriminator is not an open union Should discriminator emit a warning oif property does not exist Jan 8, 2024
@markcowl markcowl closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design:needed A design request has been raised that needs a proposal triaged:core
Projects
None yet
Development

No branches or pull requests

2 participants