Skip to content

no-nullable

Full name
@azure-tools/typespec-azure-core/no-nullable

Properties are most often not nullable but optional. Do not use | null to specify that a property is nullable. Instead, use the ? operator to indicate that a property is optional.

model Pet {
id: string;
owner: string | null;
}
model Pet {
id: string;
owner?: string;
}