Skip to content

no-unknown

Id
@azure-tools/typespec-azure-core/no-unknown

Azure 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.

  • Area: API, SDK

Allowing any JSON type makes the API and SDK unusable without extensive documentation.

model Widget {
name: unknown;
}

Use a specific type:

model Widget {
name: string;
}

Or use Record<string> for arbitrary key-value data:

model Widget {
metadata: Record<string>;
}

Treat like a type with no schema. Suppress only in the same cases you would accept additionalProperties; otherwise use a concrete type.