Skip to content

no-empty-model

Id
@azure-tools/typespec-azure-resource-manager/no-empty-model

ARM Properties with type:object that don’t reference a model definition are not allowed. ARM doesn’t allow generic type definitions as this leads to bad customer experience.

Define a named model with explicit properties instead of a generic object shape so clients and OpenAPI consumers see a concrete schema.

  • Area: API, SDK

A model that accepts any schema is difficult to use from both the API and generated SDKs.

This rule corresponds to the LintDiff rule MissingTypeObject.

model Information {
address: {};
}
model Empty {}
model Information {
address: Address;
}
model Address {
street: string;
city: string;
state: string;
country: string;
postalCode: string;
}
model Information {
street: string;
city: string;
state: string;
country: string;
postalCode: string;
}

Suppress only when required to match an existing API; otherwise use a defined type.