Skip to content

Commit

Permalink
Add common ARM parameter definitions for resource operations
Browse files Browse the repository at this point in the history
  • Loading branch information
daviwil committed Apr 5, 2021
1 parent d24d5ca commit 8551f4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/adl/lib/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ 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);
} else {
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");
}
}

Expand Down

0 comments on commit 8551f4c

Please sign in to comment.