Skip to content

Commit dbc9312

Browse files
jburgessmichaelpro1
authored andcommitted
[codegen] Fix 'super.HashCode' for oneOf and allOf Implementations (retry) (OpenAPITools#5830)
* Added hasVars after completion of all model post-processing (OpenAPITools#5587) * Post ensure-up-to-date * Update to check the size of vars and not assume non-null
1 parent d8d4d22 commit dbc9312

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java

+1
Original file line numberDiff line numberDiff line change
@@ -2320,6 +2320,7 @@ public CodegenModel fromModel(String name, Schema schema) {
23202320
for (CodegenProperty prop : m.vars) {
23212321
postProcessModelProperty(m, prop);
23222322
}
2323+
m.hasVars = m.vars.size() > 0;
23232324
}
23242325
if (m.allVars != null) {
23252326
for (CodegenProperty prop : m.allVars) {
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.3.0-SNAPSHOT
1+
4.3.1-SNAPSHOT

samples/schema/petstore/mysql/mysql_schema.sql

+14
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,13 @@ CREATE TABLE IF NOT EXISTS `EnumArrays` (
245245
`array_enum` JSON DEFAULT NULL
246246
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
247247

248+
--
249+
-- Table structure for table `EnumClass` generated from model 'EnumClass'
250+
--
251+
252+
CREATE TABLE IF NOT EXISTS `EnumClass` (
253+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
254+
248255
--
249256
-- Table structure for table `Enum_Test` generated from model 'EnumUnderscoreTest'
250257
--
@@ -377,6 +384,13 @@ CREATE TABLE IF NOT EXISTS `OuterComposite` (
377384
`my_boolean` TINYINT(1) DEFAULT NULL
378385
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
379386

387+
--
388+
-- Table structure for table `OuterEnum` generated from model 'OuterEnum'
389+
--
390+
391+
CREATE TABLE IF NOT EXISTS `OuterEnum` (
392+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
393+
380394
--
381395
-- Table structure for table `Pet` generated from model 'Pet'
382396
--
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.3.0-SNAPSHOT
1+
4.3.1-SNAPSHOT

0 commit comments

Comments
 (0)