key-visibility-required
@azure-tools/typespec-azure-core/key-visibility-requiredKey properties need to have an explicit Lifecycle visibility setting. Use the @visibility decorator to specify the appropriate visibility for key properties. Without explicit visibility, the key property uses default visibility which may not match the intended behavior.
โ Incorrect
Section titled โโ IncorrectโKey property without explicit visibility:
model Foo { @key name: string;}โ Correct
Section titled โโ CorrectโKey property with explicit Lifecycle.Read visibility:
model Foo { @key @visibility(Lifecycle.Read) name: string;}