# Workaround Mode
## Problem
Some APIs return `null` for fields that the OpenAPI schema marks as non-nullable. This causes `serde` deserialization errors when the generated client processes API responses.
## Solution
The `--workaround` / `-w` flag makes all response struct fields `Option<T>`, preventing deserialization crashes from unexpected null values.
```bash
thanix schema.yaml --workaround
```
## How It Works
When `--workaround` is enabled, all non-`Request` struct fields are wrapped in `Option<T>`, except for the `id` field:
```rust
pub struct Device {
pub id: i64, // Not wrapped
pub name: Option<String>, // Wrapped
pub status: Option<Value>, // Wrapped
pub tenant: Option<BriefTenant>, // Wrapped
}
```
```admonish warning
This weakens type safety — you'll need to `.unwrap()` or handle `None` cases for every field. Only use this when you encounter deserialization errors.
```
## Without Workaround
Without the flag, the generated types strictly follow the schema:
```rust
pub struct Device {
pub id: i64,
pub name: String, // Schema says non-nullable
pub status: Option<Value>, // Schema says nullable
pub tenant: Option<BriefTenant>, // Schema says nullable
}
```