no-unknown
@azure-tools/typespec-azure-core/no-unknownAzure services must not have properties of type unknown.
Azure services must not have properties of type unknown. All properties should have well-defined types to ensure proper serialization and client SDK generation.
Impact
Section titled “Impact”- Area: API, SDK
Allowing any JSON type makes the API and SDK unusable without extensive documentation.
❌ Incorrect
Section titled “❌ Incorrect”model Widget { name: unknown;}✅ Correct
Section titled “✅ Correct”Use a specific type:
model Widget { name: string;}Or use Record<string> for arbitrary key-value data:
model Widget { metadata: Record<string>;}Suppression
Section titled “Suppression”Treat like a type with no schema. Suppress only in the same cases you would accept additionalProperties; otherwise use a concrete type.