# JSON with hyphenated or reserved keys

**A single object shape.**

## Input

```json
{
  "content-type": "application/json",
  "x-request-id": "abc123",
  "class": "primary"
}
```

## TypeScript

```typescript
export interface Root {
  "content-type": string;
  "x-request-id": string;
  class: string;
}
```

## Zod

```typescript
import { z } from 'zod';

export const RootSchema = z.object({
  "content-type": z.string(),
  "x-request-id": z.string(),
  class: z.string(),
});
```

## Warnings

### Keys that are not valid identifiers (info)

`content-type` and `x-request-id` cannot appear unquoted, so they are quoted in both outputs and must be accessed with bracket notation.

---

Canonical URL: https://json-to-types.gumballtools.com/types/json-with-hyphenated-keys
JSON API: `POST https://json-to-types.gumballtools.com/api/v1/convert`
MCP endpoint: `https://json-to-types.gumballtools.com/api/mcp`
