feat: add nullable support for object properties
Map TypeSpec `T | null` unions to Lexicon nullable field:
- `email?: string | null` → nullable: ["email"]
- `age: int32 | null` → nullable: ["age"]
Implementation:
- Detect Union types containing null variant
- Extract non-null type and process normally
- Add property name to nullable array on object
- Emit nullable field with array of nullable property names
Example:
```typespec
model User {
name: string;
email?: string | null; // Optional and can be null
age: int32 | null; // Required but can be null
}
```
Emits:
```json
{
"type": "object",
"required": ["name", "age"],
"nullable": ["email", "age"],
"properties": {
"name": { "type": "string" },
"email": { "type": "string" },
"age": { "type": "integer" }
}
}
```
Tests: All 23 existing tests remain green (no fixtures changed)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>