Skip to content

Commit 2c2d690

Browse files
authored
fix: remove "hack" to skip schema-mapped models (#19191)
That method relied on the faulty assumption that toModelFilename does not consider mappings, which is not the case for multiple generators.
1 parent aa7c62a commit 2c2d690

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -469,14 +469,7 @@ void generateModels(List<File> files, List<ModelMap> allModels, List<String> unu
469469
try {
470470
//don't generate models that have an import mapping
471471
if (config.schemaMapping().containsKey(name)) {
472-
LOGGER.debug("Model {} not imported due to import mapping", name);
473-
474-
for (String templateName : config.modelTemplateFiles().keySet()) {
475-
// HACK: Because this returns early, could lead to some invalid model reporting.
476-
String filename = config.modelFilename(templateName, name);
477-
Path path = java.nio.file.Paths.get(filename);
478-
this.templateProcessor.skip(path, "Skipped prior to model processing due to schema mapping.");
479-
}
472+
LOGGER.info("Model {} not generated due to schema mapping", name);
480473
continue;
481474
}
482475

0 commit comments

Comments
 (0)