Skip to content

Commit 24042cb

Browse files
feat: Update generated map key serialization from camelCase to snake_case and fix nullable list parsing.
1 parent 96fb86f commit 24042cb

4 files changed

Lines changed: 376 additions & 3 deletions

File tree

packages/spark_generator/test/endpoint_generator_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ void main() {
13941394
expect(
13951395
output,
13961396
contains(
1397-
"if (result.nextTier != null) 'nextTier': result.nextTier!.map((k, v) => MapEntry(k, v))",
1397+
"if (result.nextTier != null) 'next_tier': result.nextTier!.map((k, v) => MapEntry(k, v))",
13981398
),
13991399
);
14001400
},

packages/spark_generator/test/list_parsing_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void main() {
167167
expect(
168168
output,
169169
contains(
170-
'nullableTags: (rawBody as Map<String, dynamic>)["nullableTags"] == null ? null : ((rawBody as Map<String, dynamic>)["nullableTags"] as List).map((e) => e.toString()).toList()',
170+
'nullableTags: (rawBody as Map<String, dynamic>)["nullable_tags"] == null ? null : ((rawBody as Map<String, dynamic>)["nullable_tags"] as List).map((e) => e.toString()).toList()',
171171
),
172172
);
173173

packages/spark_generator/test/reproduction_map_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void main() {
130130
expect(
131131
output,
132132
contains(
133-
"if (result.nextTier != null) 'nextTier': result.nextTier!.map((k, v) => MapEntry(k, v))",
133+
"if (result.nextTier != null) 'next_tier': result.nextTier!.map((k, v) => MapEntry(k, v))",
134134
),
135135
);
136136

0 commit comments

Comments
 (0)