Repository navigation
Commit 12df131
feat(openapi)!: remove omitUndefinedProperties option from OpenAPI serializer (#2441)
## Summary
The OpenAPI serializer now always omits object properties whose value is
`undefined`. The `omitUndefinedProperties` option has been removed from
`OpenAPIJsonSerializerOptions`, and therefore also from
`OpenAPISerializer`, which passed it through.
- `undefined` at the root or inside arrays still serializes to `null`,
so array positions are preserved.
- Removed the two tests that disabled the option, and renamed "omits
undefined object properties by default" to "omits undefined object
properties".
## Breaking change
Passing `omitUndefinedProperties: false` is now a type error. Undefined
properties that used to be serialized as `null` are now dropped.
The RPC serializer (`RPCJsonSerializer`) still has its own option with
the same name and is unchanged.
## Testing
`pnpm format`, `pnpm check` and `pnpm test` pass.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01VVaw7NURoYQTyieSmsdvMZ)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent ec2b626 commit 12df131
3 files changed
Lines changed: 2 additions & 22 deletions
File tree
- packages/openapi/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | 355 | | |
361 | 356 | | |
362 | 357 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | 136 | | |
144 | 137 | | |
145 | 138 | | |
| |||
151 | 144 | | |
152 | 145 | | |
153 | 146 | | |
154 | | - | |
155 | 147 | | |
156 | 148 | | |
157 | | - | |
158 | | - | |
159 | 149 | | |
160 | 150 | | |
161 | 151 | | |
| |||
323 | 313 | | |
324 | 314 | | |
325 | 315 | | |
326 | | - | |
| 316 | + | |
327 | 317 | | |
328 | 318 | | |
329 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | 383 | | |
389 | 384 | | |
390 | 385 | | |
| |||
0 commit comments