You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix issue 22209: [JAVA-gen] Fix oneOf inheritance: prevent generation of abstract wrapper and ensure real POJO model is produced
- Add useOneOfPojo option to generate real POJO classes for oneOf schemas instead of wrapper models
- Override updateModelForComposedSchema() to restore original vars when option is enabled
- Process the option in processOpts() method with default value false for backward compatibility
fixes#22209
cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)"));
345
346
cliOptions.add(CliOption.newBoolean(USE_ONE_OF_INTERFACES, "whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface"));
347
+
cliOptions.add(CliOption.newBoolean(USE_ONE_OF_POJO, "Generate real POJO classes for oneOf schemas instead of wrapper models").defaultValue("false"));
346
348
347
349
CliOptiondateLibrary = newCliOption(DATE_LIBRARY, "Option. Date library to use").defaultValue(this.getDateLibrary());
348
350
Map<String, String> dateOptions = newHashMap<>();
@@ -402,6 +404,31 @@ public AbstractJavaCodegen() {
0 commit comments