forked from loafle/openapi-generator-original
[dart-dio] Add missing imports for container parameters (#8355)
* also remove redundant needToImport check
This commit is contained in:
parent
f5b2bb5057
commit
3b6c2b2342
@ -558,6 +558,18 @@ public class DartClientCodegen extends DefaultCodegen {
|
||||
}
|
||||
}
|
||||
}
|
||||
for (CodegenParameter p : op.allParams) {
|
||||
if (p.isContainer) {
|
||||
final String type = p.isArray ? "array" : "map";
|
||||
if (typeMapping().containsKey(type)) {
|
||||
final String value = typeMapping().get(type);
|
||||
// Also add container imports for parameters.
|
||||
if (needToImport(value)) {
|
||||
op.imports.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return op;
|
||||
}
|
||||
|
||||
|
@ -327,7 +327,7 @@ public class DartDioClientCodegen extends DartClientCodegen {
|
||||
Set<String> imports = new HashSet<>();
|
||||
for (String item : op.imports) {
|
||||
if (needToImport(item)) {
|
||||
if (importMapping().containsKey(item) && needToImport(item)) {
|
||||
if (importMapping().containsKey(item)) {
|
||||
fullImports.add(importMapping().get(item));
|
||||
} else {
|
||||
imports.add(underscore(item));
|
||||
|
Loading…
x
Reference in New Issue
Block a user