From 8551f4cea29d43b53feebb1fe7f9092af9fbc670 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 2 Apr 2021 14:36:56 -0700 Subject: [PATCH] Add common ARM parameter definitions for resource operations --- packages/adl/lib/decorators.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/adl/lib/decorators.ts b/packages/adl/lib/decorators.ts index d06e0c7d8..ff67bdcaf 100644 --- a/packages/adl/lib/decorators.ts +++ b/packages/adl/lib/decorators.ts @@ -72,7 +72,7 @@ export function isNumericType(target: Type): boolean { const formatValues = new Map(); 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"); } }