microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
a6b7827fcd2db3bf604d42e235216c8d5b244f13

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

docs/release-notes/release-2022-09-07.md

73lines · modepreview

---
title: September 2022
---

# Release Notes September 2022 (2022-09-07)

This release contains **breaking changes**:

- **`Api`**: Remove `Type` suffix
- **`TypeSpec`**: Rename `Page` to `CollectionWithNextLink`
- **`Api`**: `Enum.members` change typed from `EnumMember[]` to `Map<string, EnumMember>`
- **`TypeSpec`** **`Api`**: **Deprecation** of `@consumes` `@produces` decorators

## **[API]** `Type` suffix removed from most `Type`s

The following types have been renamed in the compiler API:

- `ModelType` -> `Model`
- `ModelTypeProperty` -> `ModelProperty`
- `InterfaceType` -> `Interface`
- `EnumType` -> `Enum`
- `EnumMemberType` -> `EnumMember`
- `TemplateParameterType` -> `TemplateParameter`
- `NamespaceType` -> `Namespace`
- `OperationType` -> `Operation`
- `StringLiteralType` -> `StringLiteral`
- `NumericLiteralType` -> `NumericLiteral`
- `BooleanLiteralType` -> `BooleanLiteral`
- `TupleType` -> `Tuple`
- `UnionType` -> `Union`
- `UnionTypeVariant` -> `UnionVariant`
- `ProjectionType` -> `Projection`

Update uses of the type names on the left with the type names on the right. The old names can still be used but they are deprecated and may be removed from a future release.

## [TYPESPEC] Rename `Page` to `CollectionWithNextLink`

In library `@typespec/rest` in `TypeSpec.Rest.Resources` namespace the `Page` model was renamed to `CollectionWithNextLink`.
This resolve an issue with `Page` being to generic of a name for this very opinionated model.

Before

```typespec
op test(): Page<MyResource>;
```

Rename to

```typespec
op test(): CollectionWithNextLink<MyResource>;
```

## **[Api]** `Enum.members` change to `Map` [#953](https://github.com/microsoft/typespec/pull/953)

Changed the type of the `members` property of `Enum` from `EnumMember[]` => `Map<string, EnumMember>`

```diff
-members: EnumMember[];
+members: Map<string, EnumMember>
```

## [TypeSpec] [Api] **Deprecation**: `@consumes` `@produces`

Consumption of the data set by decorators was already removed in a previous release. Using them was a no-op.

The following are deprecated and will be removed in next release.

- `@consumes`
- `@produces`
- `getConsumes`
- `getProduces`

Alternative is to use a `@header contentType: <contentType>` property on the operation parameters or return type