Commit cf8e437
authored
Allow non-unique values in oneOf.discriminator.mapping (#225)
Allow non-unique values in oneOf.discriminator.mapping
### Motivation
Fixes #223, see the issue for details.
### Modifications
Changed the logic for deriving the enum cases to take both the mapping and the list of subschemas into account. Documented it more in code.
### Result
Now adopter can actually have different keys pointing to the same types in their mapping - originally reported by an adopter, so it's a real issue.
### Test Plan
Adapted tests.
Reviewed by: glbrntt
Builds:
✔︎ pull request validation (5.8) - Build finished.
✔︎ pull request validation (5.9) - Build finished.
✔︎ pull request validation (docc test) - Build finished.
✔︎ pull request validation (integration test) - Build finished.
✔︎ pull request validation (nightly) - Build finished.
✔︎ pull request validation (soundness) - Build finished.
#2251 parent a0df460 commit cf8e437
File tree
10 files changed
+361
-200
lines changed- Sources/_OpenAPIGeneratorCore
- Layers
- Renderer
- Translator
- CommonTranslations
- CommonTypes
- TypeAssignment
- Tests
- OpenAPIGeneratorCoreTests/Translator/CommonTypes
- OpenAPIGeneratorReferenceTests
- Resources/ReferenceSources
- Petstore_FF_MultipleContentTypes
- Petstore
10 files changed
+361
-200
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
639 | 644 | | |
640 | 645 | | |
641 | 646 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
| |||
Lines changed: 58 additions & 45 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
155 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
156 | 144 | | |
157 | | - | |
158 | | - | |
| 145 | + | |
| 146 | + | |
159 | 147 | | |
160 | 148 | | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
167 | 160 | | |
168 | | - | |
169 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
170 | 187 | | |
171 | | - | |
172 | | - | |
| 188 | + | |
173 | 189 | | |
174 | 190 | | |
175 | | - | |
| 191 | + | |
176 | 192 | | |
177 | 193 | | |
178 | 194 | | |
| |||
211 | 227 | | |
212 | 228 | | |
213 | 229 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | 230 | | |
218 | 231 | | |
219 | | - | |
| 232 | + | |
220 | 233 | | |
221 | 234 | | |
222 | 235 | | |
| |||
Lines changed: 4 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | 423 | | |
427 | 424 | | |
428 | | - | |
| 425 | + | |
429 | 426 | | |
430 | 427 | | |
431 | 428 | | |
432 | | - | |
| 429 | + | |
433 | 430 | | |
434 | | - | |
| 431 | + | |
435 | 432 | | |
436 | 433 | | |
437 | 434 | | |
438 | 435 | | |
439 | | - | |
| 436 | + | |
440 | 437 | | |
441 | 438 | | |
442 | 439 | | |
| |||
0 commit comments