Skip to content

July 2022

Release Notes July 2022 (2022-07-08)

This release contains breaking changes

  • Emitter options normalized to use kebab-case instead of camelCase.
  • @serviceHost decorator replaced by @server decorator
  • Versioning decorators now use enumerated values instead of strings

Impact on ARM specifications

  • Scripts that call typespec from the command line must be updated to use the new emitter option caseing, as described in the migration guide.
  • Visual studio projects that use the <TypeSpec> element will need to be updated to use the new emitter option casing, as described in the migration guide.

Emitter options

This release brings a stricter option definition for emitters and requires usage of those options to be specified with the fully qualified name to prevent conflicts. All options have also been renamed to match kebab-case naming. The options can also be specified via the tspconfig.yaml file.

@serviceHost decorator replaced with @server decorator

Note that it is unlikely that this change has any impact on existing ARM specs. The @serviceHost decorator that decorated the root namespace was used to specify the domain name of the base service endpoint. This functionality has been replaced by the @server decorator, which allows specifying full and parametrized Uris for the service endpoint, as described here

Before

@serviceHost("example.com")
namespace MyService;

After

@server("https://example.com", "The endpoint for my service")
namespace MyService;

Versioning uses enums instead of strings

Note that it is unlikely that this change has any impact on existing ARM specs. Versions must now be specified using string-valued enumerations, and each of the versioning decorators must reference an enum value rather than using the version string directly.

// Before
@versioned("2021-01-12" | "2022-01-15-preview")
namespace Api;
// After
@versioned(Versions)
namespace Api;
enum Versions { v2021_01_12: "2021-01-12", v2022_01_15_preview: "2022-01-15-preview" }
// Before
@added("2022-01-15-preview")
model Foo {}
// After
@added(Versions.v2022_01_15_preview)
model Foo {}