---
title: November 2022
---

# Release Notes for November 2022 (2022-11-11)

## **[TypeSpec]** `Azure.Core` and `Azure.ResourceManager` updated `TResource` template parameter constraint

Most of the `interface` types in these packages(e.g. `Page`, `ResourceCreateOrUpdate`, `GetResourceOperationStatus` , etc.) have been updated to have a constraint on the `TResource` template parameter. It must now be an `object`. This was already validated by the requirement for presence of `@resource` but this means that it is a built in complier validation.

In most cases this shouldn't affect you as you will already be passing an object to one of those templates. However if you defined your own template expecting a TResource that would be referencing one of those updated templates you will get an error. This can be resolved by defining the same constraint on your own parameter by adding `extends object`

Before

```typespec
model MyCustomPage<T> is Page<T>;
```

After

```typespec
model MyCustomPage<T extends object> is Page<T>;
```

## **[TypeSpec]** `Azure.ResourceManager` added lint rules to enforce consistent response schema and `@armResource<Operation>` decorators' usage

### `@armResource<Operation>` decorators' usage

For ARM resource operations definition, the `op` must be decorated with `@armResource<Operation>`. More specifically,

- `put`: `@armResourceCreateOrUpdate`
- `get`: `@armResourceRead` or `@armResourceList`
- `patch`: `@armResourceUpdate`
- `delete`: `@armResourceDelete`
- `post`: `@armResourceAction`

Before

```typespec
  @post
  GiveRaise(...ResourceInstanceParameters<Employee>): ArmResponse<Employee> | ErrorResponse;
```

After

```typespec
  @post
  @armResourceAction(Employee)
  GiveRaise(...ResourceInstanceParameters<Employee>): ArmResponse<Employee> | ErrorResponse;
```

### [ARM RPC008 rule](https://armwiki.azurewebsites.net/api_contracts/guidelines/rpc.html#rpc008-put-get-patch--list-must-return-the-same-resource-schema)

The response model of `put`, `get`, `patch`, `list` is enforced to be same with resource model.

Before

```typespec
  @get @armResourceRead(FooResource) read(...ResourceInstanceParameters<FooResource>): ArmResponse<AnotherFooResource> | ErrorResponse;
```

After

```typespec
  @get @armResourceRead(FooResource) read(...ResourceInstanceParameters<FooResource>): ArmResponse<FooResource> | ErrorResponse;
```

To resolve the lint issues, you can add the missing decorators or use the same resource model in response. However, the recommended way is to extend ARM operation templates on `interface`, for example:

```typespec
using Azure.ResourceManager;

@armResourceOperations
interface FooResourcess extends ResourceOperations<FooResource, FooProperties> {}
```
