Add common ARM parameter definitions for resource operations

This commit is contained in:
David Wilson 2021-04-02 14:36:56 -07:00
Родитель d24d5cab91
Коммит 8551f4cea2
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -72,7 +72,7 @@ export function isNumericType(target: Type): boolean {
const formatValues = new Map<Type, string>();
export function format(program: Program, target: Type, format: string) {
if (target.kind === "Model") {
if (target.kind === "Model" || target.kind === "ModelProperty") {
// Is it a model type that ultimately derives from 'string'?
if (getIntrinsicType(target) === "string") {
formatValues.set(target, format);
@ -80,7 +80,7 @@ export function format(program: Program, target: Type, format: string) {
throw new Error("Cannot apply @format to a non-string type");
}
} else {
throw new Error("Cannot apply @format to anything that isn't a Model");
throw new Error("Cannot apply @format to anything that isn't a Model or ModelProperty");
}
}