Commit a0df460
authored
Allow refs to oneOf/anyOf inside a oneOf with a discriminator (#224)
Allow refs to oneOf/anyOf inside a oneOf with a discriminator
### Motivation
Fixes #222.
We had a bug, where we considered oneOf/anyOf nested within a oneOf with a discriminator as not supported.
We already allowed allOf in there, but it was an oversight to disallow oneOf/anyOf there.
### Modifications
Update the isSupported logic to allow oneOf and anyOf within such oneOfs with a discriminator. Note that the nested schemas _within_ the oneOf/anyOf still must be objectish, as oneOf + discriminator always represent a JSON object.
### Result
OpenAPI docs with this nesting won't skip such schemas anymore.
### Test Plan
Updated the unit test.
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.
#2241 parent d2dbd0d commit a0df460
File tree
2 files changed
+15
-2
lines changed- Sources/_OpenAPIGeneratorCore/Translator/TypeAssignment
- Tests/OpenAPIGeneratorCoreTests/Translator/TypeAssignment
2 files changed
+15
-2
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| |||
71 | 80 | | |
72 | 81 | | |
73 | 82 | | |
74 | | - | |
| 83 | + | |
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
78 | 91 | | |
79 | 92 | | |
80 | 93 | | |
| |||
0 commit comments