# IResource.withSerializedAnnotation

- Module: [Aspire.Hosting](/reference/api/typescript/aspire.hosting.md)
- Defined on: [IResource](/reference/api/typescript/aspire.hosting/iresource.md)
- Version: `17.0.0`
- Kind: `method`

Stores a serialized ATS annotation payload on a resource, replacing any existing annotation with the same ID.

## Definition

```typescript
interface IResource {
  // ... omitted for brevity
  withSerializedAnnotation(
      annotationId: string,
      json: string): IResource;
}
```

## Signature

```typescript
withSerializedAnnotation(
    annotationId: string,
    json: string): IResource
```

## Parameters

- `annotationId` (`string`)
- `json` (`string`)

## Returns

[IResource](/reference/api/typescript/aspire.hosting/iresource.md)

## Defined on

- [IResource](/reference/api/typescript/aspire.hosting/iresource.md) -- `interface`
