Commit a1bc0c0
fix: Address code review for SchemaParser composition
Reordered `parseBaseIfPresent` so that `primary` (the dominant
non-null TypeName) is only computed after the two implicit-shape
early-return branches (object/array keyword detection), ensuring
it is never evaluated unnecessarily.
Pinned the empty-schema → permissive ObjectSchema behaviour with a
new `parsesEmptySchemaAsPermissiveObject` test, which documents the
intentional deviation from the old NullSchema return.
Added a `parsesEmptyAllOfAsPermissiveObject` regression test to
confirm that `allOf: []` (zero assertions) falls through to the
permissive-object fallback.
Strengthened `allOfBranchesFlattenIntoOuterAllOf` with per-part
instanceof assertions and concrete minLength/maxLength constraint
checks on the flattened StringSchema parts.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 5e9b32c commit a1bc0c0
2 files changed
Lines changed: 28 additions & 4 deletions
File tree
- src
- main/java/com/retailsvc/http/spec/schema
- test/java/com/retailsvc/http/spec/schema
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 61 | | |
66 | 62 | | |
67 | 63 | | |
68 | 64 | | |
69 | 65 | | |
70 | 66 | | |
71 | 67 | | |
| 68 | + | |
| 69 | + | |
72 | 70 | | |
73 | 71 | | |
74 | 72 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
238 | 259 | | |
239 | 260 | | |
240 | 261 | | |
| |||
250 | 271 | | |
251 | 272 | | |
252 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
253 | 279 | | |
254 | 280 | | |
255 | 281 | | |
| |||
0 commit comments