> For the complete documentation index, see [llms.txt](https://elixor.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://elixor.js.org/getting-json-data/type-checking-the-response.md).

# Type-checking the response

​The subscribe callback above requires bracket notation to extract the data values.

```typescript
.subscribe((data: Config) => this.config = {
    title: data['title'],
    body:  data['body']
});
```

You can't write `data.title` because TypeScript correctly complains that the `data` object from the service does not have a `title` property.

The [`Elixor.get()`](https://elixor.gitbook.io/elixor/getting-json-data) method parsed the JSON server response into the anonymous `Object` type. It doesn't know what the shape of that object is.

You can tell `Elixor` the type of the response to make consuming the output easier and more obvious.

First, define an interface with the correct shape:

```typescript
export interface Config {
  title: string;
  body: string;
}
```

Then, specify that interface as the [`Elixor.get()`](https://elixor.gitbook.io/elixor/getting-json-data) call's type parameter in the service:

{% code title="config.service.ts" %}

```typescript
getConfig() {
  // now returns an Observable of Config
  return elixor.get<Config[]>(this.configUrl);
}
```

{% endcode %}

The callback in the updated component method receives a typed data object, which is easier and safer to consume:

{% code title="Config.tsx" %}

```typescript
config: Config[];

showConfig() {
  getConfig()
    // clone the data object, using its known Config shape
    .subscribe((data: Config[]) => this.config = { ...data });
}
```

{% endcode %}
