Commit e7bf897
committed
fix(InlineModelResolver): do not merge untitled inline schemas differing only by description
The structural-signature dedup fallback added for multi-file OAS 3.1 specs
(#23856) strips description/type/example at every level and was applied to all
schemas in matchGenerated()/addGenerated(). For untitled inline schemas that are
structurally identical once those fields are stripped but intentionally distinct
(e.g. two response properties differing only by description), this collapsed them
into a single generated type, changing one property's type and breaking compiling
user code (regression since 7.23).
Restrict the structural-signature fallback to titled schemas only, mirroring the
existing titled-only guards in flatten() pre-population and deduplicateComponents()
("anonymous schemas may be intentionally distinct"). Exact-signature matching is
unaffected, so genuine duplicates are still reused.
Fixes #24004
Signed-off-by: seonwoo_jung <79202163+seonwooj0810@users.noreply.github.com>1 parent a179190 commit e7bf897
2 files changed
Lines changed: 74 additions & 4 deletions
File tree
- modules/openapi-generator/src
- main/java/org/openapitools/codegen
- test/java/org/openapitools/codegen
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
865 | | - | |
866 | | - | |
867 | | - | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
868 | 879 | | |
869 | 880 | | |
870 | 881 | | |
| |||
876 | 887 | | |
877 | 888 | | |
878 | 889 | | |
879 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
880 | 895 | | |
881 | 896 | | |
882 | 897 | | |
| |||
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
277 | 332 | | |
278 | 333 | | |
279 | 334 | | |
| |||
0 commit comments