Skip to content

no-empty-model

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

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;
}

Impacts the API and generated SDKs: this corresponds to the LintDiff rule MissingTypeObject and makes the schema too broad because any schema is accepted. Ask the author to use a defined type instead. Do not accept a suppression unless it is needed to match existing APIs.