Add common ARM parameter definitions for resource operations
This commit is contained in:
Родитель
d24d5cab91
Коммит
8551f4cea2
|
@ -72,7 +72,7 @@ export function isNumericType(target: Type): boolean {
|
||||||
const formatValues = new Map<Type, string>();
|
const formatValues = new Map<Type, string>();
|
||||||
|
|
||||||
export function format(program: Program, target: Type, format: 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'?
|
// Is it a model type that ultimately derives from 'string'?
|
||||||
if (getIntrinsicType(target) === "string") {
|
if (getIntrinsicType(target) === "string") {
|
||||||
formatValues.set(target, format);
|
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");
|
throw new Error("Cannot apply @format to a non-string type");
|
||||||
}
|
}
|
||||||
} else {
|
} 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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче