Commit 8d3c87b
committed
address review: recognise object branches with type union (e.g. {object,null})
CodeRabbit pointed out that 'branch.type == "object"' misses union type
arrays produced by nullable normalisation (type = {"object", "null"}).
Added a small helper that treats branch.type as either a string or a list.
Added a regression test covering the nullable object branch.
(Did not adopt the proposal to per-branch validate and pick the matching
object branch: parse_deep_object is schema-agnostic about which keys it
collects, so all object branches see the same parsed object, and the
downstream jsonschema validator on the full anyOf/oneOf already evaluates
every branch. Branch order only affects per-property type coercion via
coerce_object_values, and in practice deepObject filters use uniform
property types — adding per-branch jsonschema validation here would
duplicate work without changing acceptance behaviour.)1 parent ff1fab3 commit 8d3c87b
2 files changed
Lines changed: 31 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
265 | 275 | | |
266 | | - | |
| 276 | + | |
267 | 277 | | |
268 | 278 | | |
269 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
275 | 295 | | |
0 commit comments