forked from loafle/openapi-generator-original
[dart][dio] Respect import-mappings parameter (#10528)
* first check import mappings before defaulting to model import * respect primitive types when generating serializes, these can still be models if passed via generator args
This commit is contained in:
parent
71afbf5909
commit
34f475f7f7
@ -420,6 +420,8 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen {
|
||||
continue;
|
||||
}
|
||||
resultImports.add(i);
|
||||
} else if (importMapping().containsKey(modelImport)) {
|
||||
resultImports.add(importMapping().get(modelImport));
|
||||
} else {
|
||||
resultImports.add("package:" + pubName + "/src/model/" + underscore(modelImport) + ".dart");
|
||||
}
|
||||
|
@ -105,7 +105,13 @@ class _${{classname}}Serializer implements StructuredSerializer<{{classname}}> {
|
||||
result.{{{name}}}.replace(valueDes);
|
||||
{{/isContainer}}
|
||||
{{#isModel}}
|
||||
{{#isPrimitiveType}}
|
||||
{{! These are models that have nee manually marked as primitve via generator param. }}
|
||||
result.{{{name}}} = valueDes;
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
result.{{{name}}}.replace(valueDes);
|
||||
{{/isPrimitiveType}}
|
||||
{{/isModel}}
|
||||
{{^isContainer}}
|
||||
{{^isModel}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user