-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix code generator for request and response body
- Loading branch information
1 parent
51b249d
commit 94dc1a0
Showing
3 changed files
with
104 additions
and
48 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/WireMockInspector/CodeGenerators/CollectionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace WireMockInspector.CodeGenerators; | ||
|
||
internal static class CollectionExtensions | ||
{ | ||
public static IDictionary<string, T>? OrNullWhenEmpty<T>(this IDictionary<string, T>? @this) | ||
{ | ||
if (@this == null || @this.Count == 0) | ||
{ | ||
return null; | ||
} | ||
|
||
return @this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters