This commit is contained in:
William Cheng
2022-06-08 14:21:16 +08:00
parent 14aef2c93d
commit e3bca56bfb
2 changed files with 5 additions and 5 deletions

View File

@@ -2201,9 +2201,9 @@ public class DefaultCodegen implements CodegenConfig {
// get the schema/model name from $ref
String schemaName = ModelUtils.getSimpleRef(unaliasSchema.get$ref());
if (StringUtils.isNotEmpty(schemaName)) {
if (importMapping.containsKey(schemaName)) {
/*if (importMapping.containsKey(schemaName)) {
return schemaName;
}
}*/
return getAlias(schemaName);
} else {
LOGGER.warn("Error obtaining the datatype from ref: {}. Default to 'object'", unaliasSchema.get$ref());

View File

@@ -1206,10 +1206,10 @@ public class ModelUtils {
if (schema != null && StringUtils.isNotEmpty(schema.get$ref())) {
String simpleRef = ModelUtils.getSimpleRef(schema.get$ref());
if (importMappings.containsKey(simpleRef)) {
LOGGER.debug("Schema unaliasing of {} omitted because aliased class is to be mapped to {}", simpleRef, importMappings.get(simpleRef));
/*if (importMappings.containsKey(simpleRef)) {
LOGGER.info("Schema unaliasing of {} omitted because aliased class is to be mapped to {}", simpleRef, importMappings.get(simpleRef));
return schema;
}
}*/
Schema ref = allSchemas.get(simpleRef);
if (ref == null) {
once(LOGGER).warn("{} is not defined", schema.get$ref());