@@ -70,6 +70,9 @@ class GeneratorArguments {
70
70
/// Defines mappings between OpenAPI spec types and generated types.
71
71
final Map <String , String >? typeMappings;
72
72
73
+ /// Defines mappings between OpenAPI spec var/param/model and generated code.
74
+ final Map <String , String >? nameMappings;
75
+
73
76
/// Adds reserved words mappings.
74
77
///
75
78
/// Supported by [Generator.dio] & [Generator.dioAlt] generators.
@@ -89,6 +92,7 @@ class GeneratorArguments {
89
92
generator =
90
93
annotations.readPropertyOrDefault ('generatorName' , Generator .dart),
91
94
typeMappings = annotations.readPropertyOrNull ('typeMappings' ),
95
+ nameMappings = annotations.readPropertyOrNull ('nameMappings' ),
92
96
importMappings = annotations.readPropertyOrNull ('importMappings' ),
93
97
reservedWordsMappings =
94
98
annotations.readPropertyOrNull ('reservedWordsMappings' ),
@@ -167,6 +171,8 @@ class GeneratorArguments {
167
171
'--import-mappings=${importMappings !.entries .fold ('' , foldStringMap ())}' ,
168
172
if (typeMappings? .isNotEmpty ?? false )
169
173
'--type-mappings=${typeMappings !.entries .fold ('' , foldStringMap ())}' ,
174
+ if (nameMappings? .isNotEmpty ?? false )
175
+ '--name-mappings=${nameMappings !.entries .fold ('' , foldStringMap ())}' ,
170
176
if (inlineSchemaOptions != null )
171
177
'--inline-schema-options=${inlineSchemaOptions !.toMap ().entries .fold ('' , foldStringMap (keyModifier : convertToPropertyKey ))}' ,
172
178
if (additionalProperties != null )
0 commit comments