Skip to content

May 2023

  • Add @encode decorator, with new formats for date and duration encoding support
    • "rfc3339", "rfc7231' for utcDateTime, offsetDateTime types
    • "unixTimestamp" support for utcDateTime type
    • "iso8601" support for duration types
    • "base64", "base64url" support for bytes types
  • Allow default values for required model properties and parameters
  • sourceModel property added to Model types
  • sourceOperation property added to Operation types
  • Model and Scalar types added to TypeSpec.Reflection namespace
  • add @sharedRoute decorator
  • allow union types within a response status code
  • Enhanced support for shared routes
  • Support for union types within a response status code
  • General fixes to generated reference documentation for all modules
  • Fix: compiler mismatch error recommendation
  • Fix: Interface with templated operation causing crash if defined after use
  • Fix: Issue with templated operations in templated interface would get cached only by keying on the operation template args.
  • Fix: missing-index diagnostic showing at the wrong location
  • Fix: --emit pointing to emitter js entrypoint resolve correct options
  • Fix: scalar template parameter name conflict with each other
  • Fix: incorrect resolution of tsp version
  • Fix: always loading current version of compiler
  • Fix openapi3 emitter to mark request body required
  • Fix issue where shared request bodies did not emit correctly.
  • Add validation to ensure that @action or @collectionAction operations have a specified name when used with @sharedRoute
  • Fix: Crash during validation when using certain templated models from versioned library
  • Added validation preventing version enums from having duplicate values.
  • Fix issue where “is” dependencies were not detected.
  • Raise error if versioned spec specifies a single service version.

@typespec/compiler: isTemplateDeclaration will only return true for the original declaration and not partially instantiated templates

Section titled “@typespec/compiler: isTemplateDeclaration will only return true for the original declaration and not partially instantiated templates”

If library or emitter code needs to detect a partially instantiated template, the code will need to check isTemplateInstance and isTemplateDeclaration properties are false.

@typespec/compiler: Use @encode instead of @format for encoding scalars and properties of type bytes

Section titled “@typespec/compiler: Use @encode instead of @format for encoding scalars and properties of type bytes”

The new @encode decorator should be used whenever the serialized type on the wire differs from the analogous TypeSpec type

model Foo {
@format("base64url")
bar: bytes;
}
model Foo {
@encode("base64url")
bar: bytes;
}

http: Use @sharedRoute instead of the shared property of @route options

Section titled “http: Use @sharedRoute instead of the shared property of @route options”

The new @sharedRoute decorator replaces @route options for identifying operations that share a route

Old deprecated usage of @route decorator shared option

Section titled “Old deprecated usage of @route decorator shared option”
@route(
"/doStuff",
{
shared: true,
}
)
op doIntStuff(input: int32): int32;
@route(
"/doStuff",
{
shared: true,
}
)
op doStringStuff(input: string): string;
@sharedRoute
@route("/doStuff")
op doIntStuff(input: int32): int32;
@sharedRoute
@route("/doStuff")
op doStringStuff(input: string): string;