October 2023
New Features
Section titled âNew Featuresâ@typespec/compiler New Features
Section titled â@typespec/compiler New Featuresâ- The
nevertype is now assignable to all types. - Allow constraint decorators (e.g.
@minValue,@maxValue,@maxLength, etc.) to be applied to nullable types. - Add support for
@returnsand@errorsdoc comment tags.@returns(or@returnsDocdecorator) can be used to describe the success return types of an operation.@errors(or@errorsDocdecorator) can be used to describe the error return types of an operation.
- Skip emit of
deprecateddiagnostic for a type reference that is used in a deprecated declaration statement. - Improve website performance by removing
decoratorsexport and importing decorators individually.
@typespec/http New Features
Section titled â@typespec/http New Featuresâ- Add support for
@returnsand@errorsdoc comment tags. - Add support for status code ranges for http responses. Change to API Http responses can now also return a
HttpStatusCodeRangeobject for their status codes. - Emit error diagnostic when multiple properties on a response model have the
@statusCodedecorator.
@typespec/json-schema New Features
Section titled â@typespec/json-schema New Featuresâ- Disable folding of serialized yaml if line is above 80 characters.
@typespec/openapi New Features
Section titled â@typespec/openapi New Featuresâ- Remove
@typespec/restas apeerDependency. - Support Http Status Code ranges.
- Breaking Change Changed namespace from
OpenAPItoTypeSpec.OpenAPI.
@typespec/openapi3 New Features
Section titled â@typespec/openapi3 New Featuresâ- Remove
@typespec/restas apeerDependency. - Add support for constraints on union types.
- Add support for
@returnsand@errorsdoc comment tags. - Add support for http status code ranges.
@typespec/protobuf New features
Section titled â@typespec/protobuf New featuresâ- Added support for emitting documentation comments in protobuf specifications.
@typespec/rest New features
Section titled â@typespec/rest New featuresâ- Remove peer dependency on
@typespec/httplibrary.
Bug Fixes
Section titled âBug Fixesâ@typespec/compiler Bug Fixes
Section titled â@typespec/compiler Bug Fixesâ- Fix: Correct handling of hyphens in doc comments.
- Fix: Colorization of line comments extending into the next line.
- Fix: Crash when using parentheses in directives.
- Fix: Allow assigning negative and 0 values to
float64types. - Fix: Return non-zero format code when tsp formatting fails.
- Fix: Correct formatting of anonymous unions to exclude leading â:â character.
- Fix: Unions and Enum members are now formatted following the same rules as model properties. An extra line will be added between members if the member is annotated with a decorator, directive or doc comment.
- Fix: Correct formatting of comments between a directive or doc and its node.
- Fix:
tsp initwas not creating thetspconfig.yamlfile for templates that specified it. - Fix:
tsp initwill create a placeholdertspconfig.yamlfile for templates that donât specify an explicit one. - Fix:
tsp initwas ignoring thefilesspecified in an init template. - Fix: Language Server wasnât loading the
tspconfig.yamlcorrectly resulting in some options being dropped, like the linter configuration. - Fix: Allow
nullto be assigned as a default value. - Fix: Using
TypeSpec.Xyznamespace shouldnât require theTypeSpec Prefix.
@typespec/openapi3 Bug Fixes
Section titled â@typespec/openapi3 Bug Fixesâ- Fix: Correctly generate discriminated union mapping property with multiple visibilities.
- Fix: Crash when assigning a numeric default to a union.
- Fix: Using format
ssvorpipesin@headerproduced an invalid OpenAPI3 schema. It will now change the type to string, ignore the format, and emit a warning diagnostic. - Fix: Allow using null as a default value.
- Fix: Allow use of
@oneOfon model properties. - Fix: Correct representation of CSV format.
- Fix: Remove incorrect
statusCodefield for operations with shared routes.
@typespec/rest Bug Fixes
Section titled â@typespec/rest Bug Fixesâ- Fix:
@keycan now appear on the base model of a resource.
@typespec/versioning Bug Fixes
Section titled â@typespec/versioning Bug Fixesâ- Ensure that use of
@renamedFromdoes not result in duplicate properties on a model.
Breaking Changes
Section titled âBreaking Changesâ@typespec/http Breaking Changes
Section titled â@typespec/http Breaking Changesâ- Http responses can now also return a
HttpStatusCodeRangeobject for their status codes. Emitters will need to handle the additional status code content when processing status codes. - Emit error diagnostic when multiple properties on a response model have the
@statusCodedecorator.
@typespec/openapi Breaking Changes
Section titled â@typespec/openapi Breaking Changesâ- Changed namespace from
OpenAPItoTypeSpec.OpenAPI.