Commit 230e288
authored
[Core] Support map/object format for x-enum-varnames and x-enum-descriptions (#23540)
The generator crashes with a ClassCastException when these vendor extensions
are provided as a JSON object (map) instead of an array. Both formats are
valid conventions used in the ecosystem (Redocly, Speakeasy, etc.).
For map format, keys are matched to enum values via toEnumValue(key, dataType)
to ensure correct matching regardless of language-specific value transformations.1 parent e317a7a commit 230e288
File tree
3 files changed
+98
-16
lines changed- modules/openapi-generator/src
- main/java/org/openapitools/codegen
- languages
- test/java/org/openapitools/codegen
3 files changed
+98
-16
lines changedLines changed: 21 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7028 | 7028 | | |
7029 | 7029 | | |
7030 | 7030 | | |
7031 | | - | |
7032 | | - | |
| 7031 | + | |
| 7032 | + | |
7033 | 7033 | | |
7034 | 7034 | | |
7035 | 7035 | | |
7036 | | - | |
| 7036 | + | |
7037 | 7037 | | |
7038 | | - | |
7039 | | - | |
7040 | | - | |
7041 | | - | |
| 7038 | + | |
| 7039 | + | |
| 7040 | + | |
| 7041 | + | |
| 7042 | + | |
| 7043 | + | |
| 7044 | + | |
| 7045 | + | |
| 7046 | + | |
| 7047 | + | |
| 7048 | + | |
| 7049 | + | |
| 7050 | + | |
| 7051 | + | |
| 7052 | + | |
| 7053 | + | |
| 7054 | + | |
| 7055 | + | |
7042 | 7056 | | |
7043 | 7057 | | |
7044 | 7058 | | |
| |||
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java
Lines changed: 36 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
762 | 775 | | |
763 | 776 | | |
764 | 777 | | |
765 | 778 | | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
770 | 797 | | |
771 | 798 | | |
772 | 799 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
995 | 995 | | |
996 | 996 | | |
997 | 997 | | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
998 | 1018 | | |
999 | 1019 | | |
1000 | 1020 | | |
| |||
2314 | 2334 | | |
2315 | 2335 | | |
2316 | 2336 | | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
2317 | 2358 | | |
2318 | 2359 | | |
2319 | 2360 | | |
| |||
0 commit comments