Commit 774c912
fix(converter): convert exclusiveMaximum/exclusiveMinimum to numeric semantics for OAS 3.1 targets
OAS 2.0 and 3.0 use boolean exclusiveMaximum/exclusiveMinimum to modify
the adjacent maximum/minimum bound. OAS 3.1 (JSON Schema 2020-12) changed
these to standalone numeric values, dropping maximum/minimum entirely.
The converter previously copied the boolean form regardless of target
version, producing invalid OAS 3.1 output.
Fix all four conversion sites:
- convertOAS2ParameterToOAS3: inline parameter type/format schema
- convertOAS2FormDataToRequestBody: formData parameter properties
- convertOAS2ItemsToSchema: nested items arrays (new c/result/path params)
- convertOAS2SchemaToOAS3: component definitions via new recursive
fixSchemaExclusiveMinMaxForOAS31 walker (mirrors walkSchemaFeatures)
For OAS 3.1 targets, each site now sets exclusiveMaximum to *maximum
and clears maximum. For OAS 3.0 targets, boolean form is preserved.
Edge case: exclusiveMaximum:true with no maximum (malformed OAS 2.0)
emits a SeverityWarning to ConversionResult at all four sites rather
than silently dropping the constraint.
Closes #358
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e92b2ec commit 774c912
4 files changed
Lines changed: 588 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
72 | 83 | | |
73 | 84 | | |
74 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
75 | 97 | | |
76 | 98 | | |
77 | | - | |
| 99 | + | |
78 | 100 | | |
79 | 101 | | |
80 | 102 | | |
| |||
206 | 228 | | |
207 | 229 | | |
208 | 230 | | |
209 | | - | |
| 231 | + | |
210 | 232 | | |
211 | 233 | | |
212 | 234 | | |
| |||
228 | 250 | | |
229 | 251 | | |
230 | 252 | | |
231 | | - | |
| 253 | + | |
232 | 254 | | |
233 | 255 | | |
234 | 256 | | |
| |||
0 commit comments