Commit 7d94b0e
committed
[Core] Support map/object format for x-enum-varnames and x-enum-descriptions
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 c07f3a0 commit 7d94b0e
3 files changed
Lines changed: 98 additions & 16 deletions
File tree
- modules/openapi-generator/src
- main/java/org/openapitools/codegen
- languages
- test/java/org/openapitools/codegen
Lines 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 | |
|---|---|---|---|
| |||
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
719 | 732 | | |
720 | 733 | | |
721 | 734 | | |
722 | 735 | | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
727 | 754 | | |
728 | 755 | | |
729 | 756 | | |
| |||
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