Skip to content

Commit 409ddb3

Browse files
docs(allof): note invalid-input handling
The merger silently skips values that would crash or produce nonsense (e.g. multipleOf <= 0). Document the policy so customers don't expect the merger to surface their invalid spec — that's a separate concern better served by spec validation. Framed broadly rather than enumerating every defensive code path so future PRs adding similar handling don't need to update the README.
1 parent 695d395 commit 409ddb3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

docs/ALLOF.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@ The following schema fields are not merged:
4343
- Discriminator
4444
- `$defs` (OpenAPI 3.1) — intentionally dropped from the flattened output. `$defs` is a reusable-schema namespace used as the target of `$ref` pointers. After `--flatten-allof` runs, the merged schema has no `$ref`s left to resolve, so the namespace contributes nothing to its semantics. Preserving it would only add noise (and risk silent collisions when two `allOf` subschemas define different things under the same `$defs` key).
4545

46+
## Invalid input handling
47+
48+
The merger is defensive about spec violations — values that would crash the merge or produce nonsense are silently skipped rather than reported. For example, `multipleOf` values that are zero or negative (disallowed by the OpenAPI / JSON Schema spec) are dropped from the merged result. To surface invalid values in your spec rather than rely on the merger swallowing them, validate the spec separately.
49+
4650
Please help us improve this feature by providing feedback and reporting issues.

0 commit comments

Comments
 (0)