May 2023
New Features
@typespec/compiler features
- Add
@encode
decorator, with new formats for date and duration encoding support"rfc3339"
,"rfc7231'
forutcDateTime
,offsetDateTime
types"unixTimestamp"
support forutcDateTime
type"iso8601"
support forduration
types"base64"
,"base64url"
support forbytes
types
- Allow default values for required model properties and parameters
sourceModel
property added toModel
typessourceOperation
property added toOperation
typesModel
andScalar
types added toTypeSpec.Reflection
namespace
@typespec/http features
- add
@sharedRoute
decorator - allow union types within a response status code
@typespec/openapi3 features
- Enhanced support for shared routes
- Support for union types within a response status code
Bug Fixes
- General fixes to generated reference documentation for all modules
@typespec/compiler fixes
- 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
@typespec/migrate fixes
- Fix: incorrect resolution of tsp version
- Fix: always loading current version of compiler
@typespec/openapi3 fixes
- Fix openapi3 emitter to mark request body required
- Fix issue where shared request bodies did not emit correctly.
@typespec/rest
- Add validation to ensure that @action or @collectionAction operations have a specified name when used with
@sharedRoute
@typespec/versioning
- 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.
Breaking Changes
@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.
Deprecations
@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
Old deprecated usage of @format
decorator
New usage of @encode
decorator
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