Skip to content

require-versioned

Id
@azure-tools/typespec-azure-core/require-versioned

Azure services should use the versioning library.

Azure services should always use the versioning library even if they have a single version. This ensures that the service is ready for future versions and generate the OpenAPI 2.0 in the correct location.

  • Area: API, SDK

Without versioning, the API cannot be updated with new api-versions.

@service
namespace Azure.MyService;
@service(#{ version: "2021-01-01" })
namespace Azure.MyService;
@service
@OpenAPI.info({
version: "2021-01-01",
})
namespace Azure.MyService;
@versioned(Versions)
@service
namespace Azure.MyService;
enum Versions {
2021_01_01: "2021-01-01",
}

Do not suppress. Add a Versions enum and reference it from the @versioned decorator on the root namespace.