Skip to content

arm-resource-invalid-version-format

Id
@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format

Check for valid versions.

ARM resource versions must follow the YYYY-MM-DD format, with an optional suffix such as -preview or a versioned suffix like -alpha.1.

  • Area: API

The api-version does not follow the required format, violating the RPC contract.

This rule corresponds to the LintDiff rule ApiVersionPattern.

@versioned(Versions)
@armProviderNamespace
namespace Microsoft.Contoso;
enum Versions {
v1: "1.2.3",
}
@versioned(Versions)
@armProviderNamespace
namespace Microsoft.Contoso;
enum Versions {
v2024_01_01: "2024-01-01",
v2024_06_01_preview: "2024-06-01-preview",
}

Suppress only when required to match an existing API; otherwise use the YYYY-MM-DD[-preview] format.