Skip to content

invalid-api-version

Id
@azure-tools/typespec-java/invalid-api-version

Severity: error

This diagnostic is issued when the api-version emitter option is neither a declared service version nor latest or all.

The requested API-version projection cannot be selected, so Java client generation fails.

@service
@versioned(Versions)
namespace Contoso;
enum Versions {
v1,
v2,
}
options:
"@azure-tools/typespec-java":
api-version: v3
Invalid api-version option: 'v3'. The value should be an api-version, 'latest', or 'all'.

Use a version declared by the service, or use latest or all.

options:
"@azure-tools/typespec-java":
api-version: v2