September 2023
New Features
@typespec/compiler
New Features
- Allow library authors to precisely define the visibility of operation templates with new decorators
@parameterVisibility
and@returnTypeVisibility
, paired with corresponding accessor methodsgetParameterVisibility
andgetReturnTypeVisibility
. - Add coloring for documentation comments in Visual Studio and Visual Studio Code language extensions.
- Change yaml parser from
js-yaml
toyaml
, enabling more precise validation and error reporting intspconfig.yaml
- Added validation to ensure that properties of a derived model (using
extends
) are compatible with the base model indexer. - Export
CompilerOptions
TypeScript type. - Report library information when library code crashes during
$onValidate
execution. - Diagnostics reported on a node with an
id
property will highlight the id instead of the entire node. For example, if a diagnostic is reported on amodel
type, the model name will be highlighted, instead of the entire model definition.
@typespec/http
New Features
- Add new helper method
resolveRequestVisibility
which incorporates settings from new core decorators@parameterVisibility
and@returnTypeVisibility
. This replaces the deprecatedgetRequestVisibility
helper. - Add new helper method
getDefaultVisibilityForVerb
which returns the default visibility for Http verbs. - Add validation step to issue a warning when an
operation is
statement does not include route information from the original operation container (interface
ornamespace
). This helps to prevent unexpected route changes when using operation references. - Add validation to prevent runtime errors when
OAuth2Auth
is given invalidOAuth2Flow
arguments.
@typespec/json-schema
New Features
- Support decimal scalar types.
@typespec/openapi3
New Features
- Allow library authors to override default Http verb visibility in operation declarations.
@typespec/protobuf
New features
- Support
omit-unreachable-types
option. - Automatically convert empty operation parameters into a reference to
google.protobuf.Empty
instead of synthesizing an empty model.
typespec-vscode
New features
- Add color definition for
@param
tag in documentation comments
Bug Fixes
@typespec/compiler
Bug Fixes
- Fix issue where specifying a directory using the
--config
command line option would search the parent folder hierarchy looking fortspconfig.yaml
. - Fix Stack overflow when a model property references itself.
- Fix compiler crash when using the alias of a namespace that has decorators.
- Fix compiler freeze when an invalid token appears between doc comment and type.
- Fix compiler crash when relating recursive types.
- Fix typo in format error diagnostic.
@typespec/openapi3
Bug Fixes
- Fixed issue where parameters marked with visibility βcreateβ did not appear in a
PATCH
request body. - Fixed incorrect usage of
exclusiveMinimum
andexclusiveMaximum
boolean properties. - Use
anyOf
instead ofoneOf
for operations with shared routes and different request or response bodies. - Fix handling of
Record<T>
inmodel is
andmodel extends
statements.
@typespec/versioning
Bug Fixes
- Fixed validation in
@typeChangedFrom
for incorrect versioned references.
Deprecations
@typespec/compiler
Deprecations
- The
@deprecated
decorator has been marked as deprecated. Use#deprecated
directive instead.
@typespec/http
Deprecations
- The
getRequestVisibility
helper function is now deprecated. UseresolveRequestVisibility
orgetDefaultVisibilityForVerb
instead.
Breaking Changes
@typespec/compiler
Breaking Changes
-
A semicolon is now required at the end of augment decorator statements. The formatter was already inserting the semicolon, if omitted. For example: