December 2023
New Features
Section titled âNew Featuresâ@typespec/compiler New Features
Section titled â@typespec/compiler New Featuresâ- New Language Feature Added string template literal in typespec. Single and multi-line strings can be interpolated with
${and}. Example\\Doc for url ${url} is here: ${location}\\ - [Emitter Framework]:
emitTypeReferencefunction takes an optional reference context that can be used to patch the context for the target. - [Emitter Framework]: Added
absolute-pathas a known format for emitter options which will validate the value passed by the user resolve to an absolute path. - [Emitter Framework]: Allow scalar and enum declarations to provide a reference context.
- [Emitter Framework]: Allow passing a custom context when calling
emitType. - Linter rules can now supply a full url to documentation.
- Upgrade formatter to
prettierversion 3.1.
@typespec/http New Features
Section titled â@typespec/http New Featuresâ- Add diagnostic when a namespace exists with routes, but no namespace is marked with
@service.
@typespec/json-schema New Features
Section titled â@typespec/json-schema New Featuresâ- Add support for simple literal default on model properties.
- Add support for
StringTemplateliterals.
@typespec/openapi3 New Features
Section titled â@typespec/openapi3 New Featuresâ- Now emits all properties of unreferenced schemas.
- Treat union variants as Discriminator.
- Emitter will now emit all properties of unreferenced schemas.
@typespec/playground New features
Section titled â@typespec/playground New featuresâ- Add a format button to the playground command bar.
- Add a notification to the standalone playground when the playground has been saved.
- Enable changing the theme.
- Add resizable panes for the editor and output
- Add ability to pass a custom footer and use
FooterandFooterItemcomponent to build your own. - Add
noopener noreferrerto footer external link - Move errors and warnings to a dedicated expandable banner at the bottom of the playground.
- BREAKING CHANGE Styles must be imported seperately with
import \"@typespec/playground/styles.css\"; - Allow standalone playground to show a loading fallback.
- Upgrade swagger-ui component.
@typespec/rest New Features
Section titled â@typespec/rest New Featuresâ- Fix issue with
ResourceCreateModeltemplate collecting âupdateâ properties instead of âcreateâ properties.
Bug Fixes
Section titled âBug Fixesâ@typespec/compiler Bug Fixes
Section titled â@typespec/compiler Bug Fixesâ- [Formatter]: Fix: Preserve parentheses in
valueofexpressions inside a union or array (e.g.(value of strring) | Model). - Fix: Union variants are now assigned to the parent union.
@typespec/json-schema Bug Fixes
Section titled â@typespec/json-schema Bug Fixesâ- Fix: Enum with a value of
0would have resulted intypeofstringandnumber. - Fix: Scalar constraints combine with base scalar constraints.
- Fix
@maxValueExclusivesettingminimumExclusiveinstead ofmaximumExclusive
@typespec/openapi3 Bug Fixes
Section titled â@typespec/openapi3 Bug Fixesâ- Fix: Report diagnostic instead of throwing errors in the case of duplicate ids or unknown scalar.
- FIX: Handle
bytesas a multipart part type correctly and producetype: string, format: binary
@typespec/playground Bug Fixes
Section titled â@typespec/playground Bug Fixesâ- Configure the program viewer to respect the color themeâ,
@typespec/versioning Bug Fixes
Section titled â@typespec/versioning Bug Fixesâ- Fix crash in versioning library`.
Breaking Changes
Section titled âBreaking Changesâ- New Language Feature string interpolation to strings in TypeSpec. Strings that use the sequence
${are now expected to start a reference to an interpolated value. Strings that contain${and are not meant for interpolation must now be escaped with a\, like this:\${.
Semantic Changes in OpenApi3 Output
Section titled âSemantic Changes in OpenApi3 Outputâ- Previously, unreferenced
Modeltypes (types not used in any operation) were emitted usingreadvisibility, meaning that properties that had onlycreateorupdatevisibility would not be included in the corresponding schema in the@typespec/openapi3emitter. In this release, all properties of unreferenced Model types will appear in the output. - Previously,
bytestypes that appeared in amultipart/form-datarequest or response would be marked as a base64 encoded string. In this release,multipart/form-databytestypes appearing in parts with anobjecttype will be treated as a base64-encoded string, while those in non-model parts will appear as raw binary data.