Skip to content

prevent-format

Full name
@azure-tools/typespec-azure-core/prevent-format

Using the @format decorator is disallowed. While in OpenAPI format: was used to both represent a known string format and a more precise type, in TypeSpec @format is only meant to represent a known pattern for a string. This means that using @format would result in a string type with some validation.

FormatType
int32int32
uriurl
urlurl
uuidAzure.Core.uuid
eTagAzure.Core.eTag
arm-idAzure.Core.armResourceIdentifier
ipv4Azure.Core.ipV4Address
ipv6Azure.Core.ipV6Address
ipv6Azure.Core.azureLocation
model Pet {
@format("uuid")
id: string;
}
model Pet {
id: Azure.Core.uuid;
}