We should consider removing #[non_exhaustive]
from models used in requests
#1856
Labels
Azure.Core
The azure_core crate
Client
This issue points to a problem in the data-plane of the library.
design-discussion
An area of design currently under discussion and open to team and community feedback.
Milestone
The
#[non_exhaustive]
attribute enforces API consumers to have version-tolerant code with..
for pattern matches and catch-all match arms to help prevent breaking changes in the future if we were to add enum variants or model fields. This is why it's called out in the guidelines.However, for models that must be constructed to be sent in requests, this prevents them from being constructed without a factory method outside the crate:
azure_security_keyvault_secrets/src/lib.rs
my_app/src/main.rs
So instead we should consider only putting
#[non_exhaustive]
on response-only models or, perhaps, not at all. We should still put#[non_exhaustive]
on both fixed and extensible enums, however.See https://github.com/Azure/typespec-rust/issues/77 for an internal discussion with more context.
The text was updated successfully, but these errors were encountered: