Commit 2c1ca02
authored
[codegen][Go] Fix compilation error of generated go code when schema is free form object (#5391)
* Fix code generation for free-form objects in go-experimental
* Execute scripts in bin directory
* Add more use cases for open-ended types
* Add more use cases for open-ended types
* Add more use cases for open-ended types
* add code comments
* Better name for test properties
* handle scenario when type is arbitrary
* handle interface{} scenario
* handle interface{} scenario
* add helper function isAnyType
* isAnyType function
* implementation of isAnyType function
* fix javadoc issue
* handle interface{} scenario
* use equals comparison instead of ==
* merge from master
* Add code documentation
* add code comments, remove unused min/max attribute, fix equals method
* Handle 'anytype' use case
* add code comments
* override postProcessModelProperty to set vendor extension
* Use vendorExtensions.x-golang-is-container
* fix compilation error of generated code
* fix compilation error of generated code
* fix compilation error of generated code1 parent 256a431 commit 2c1ca02
18 files changed
Lines changed: 564 additions & 61 deletions
File tree
- docs/generators
- modules/openapi-generator/src
- main
- java/org/openapitools/codegen
- languages
- utils
- resources/go-experimental
- test/resources/3_0
- samples/openapi3/client/petstore
- go-experimental/go-petstore
- api
- docs
- go/go-petstore/docs
- python-experimental
- docs
- petstore_api/models
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
Lines changed: 70 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
26 | 57 | | |
27 | 58 | | |
28 | | - | |
| 59 | + | |
29 | 60 | | |
30 | 61 | | |
31 | 62 | | |
| |||
47 | 78 | | |
48 | 79 | | |
49 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
50 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
51 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
52 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
53 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
54 | 105 | | |
55 | 106 | | |
56 | 107 | | |
| |||
59 | 110 | | |
60 | 111 | | |
61 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
62 | 119 | | |
63 | 120 | | |
64 | 121 | | |
| |||
76 | 133 | | |
77 | 134 | | |
78 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
79 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
80 | 145 | | |
81 | 146 | | |
82 | 147 | | |
| |||
621 | 686 | | |
622 | 687 | | |
623 | 688 | | |
624 | | - | |
| 689 | + | |
625 | 690 | | |
626 | 691 | | |
627 | 692 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1945 | 1945 | | |
1946 | 1946 | | |
1947 | 1947 | | |
| 1948 | + | |
| 1949 | + | |
1948 | 1950 | | |
1949 | 1951 | | |
1950 | 1952 | | |
1951 | 1953 | | |
1952 | 1954 | | |
1953 | 1955 | | |
1954 | 1956 | | |
1955 | | - | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
1956 | 1961 | | |
1957 | 1962 | | |
1958 | 1963 | | |
| |||
2707 | 2712 | | |
2708 | 2713 | | |
2709 | 2714 | | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
2710 | 2718 | | |
2711 | 2719 | | |
2712 | 2720 | | |
| |||
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| |||
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
119 | 131 | | |
| 132 | + | |
120 | 133 | | |
121 | 134 | | |
122 | 135 | | |
| |||
303 | 316 | | |
304 | 317 | | |
305 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
306 | 325 | | |
307 | 326 | | |
308 | 327 | | |
| |||
342 | 361 | | |
343 | 362 | | |
344 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
345 | 370 | | |
346 | 371 | | |
347 | 372 | | |
| |||
350 | 375 | | |
351 | 376 | | |
352 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
353 | 381 | | |
354 | 382 | | |
355 | 383 | | |
| |||
556 | 584 | | |
557 | 585 | | |
558 | 586 | | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
559 | 598 | | |
560 | 599 | | |
561 | 600 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
Lines changed: 57 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
639 | | - | |
| 639 | + | |
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
660 | 696 | | |
661 | 697 | | |
662 | 698 | | |
| |||
665 | 701 | | |
666 | 702 | | |
667 | 703 | | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
668 | 723 | | |
669 | 724 | | |
670 | 725 | | |
| |||
1361 | 1416 | | |
1362 | 1417 | | |
1363 | 1418 | | |
1364 | | - | |
| 1419 | + | |
0 commit comments