# JSON with repeated shapes

**An object with 1 nested shapes.**

## Input

```json
{
  "billingAddress": { "line1": "1 Main St", "city": "Austin", "zip": "78701" },
  "shippingAddress": { "line1": "2 Oak Ave", "city": "Austin", "zip": "78702" }
}
```

## TypeScript

```typescript
export interface Root {
  billingAddress: BillingAddress;
  shippingAddress: BillingAddress;
}

export interface BillingAddress {
  line1: string;
  city: string;
  zip: string;
}
```

## Zod

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

export const BillingAddressSchema = z.object({
  line1: z.string(),
  city: z.string(),
  zip: z.string(),
});

export const RootSchema = z.object({
  billingAddress: BillingAddressSchema,
  shippingAddress: BillingAddressSchema,
});
```

---

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