-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use latest ProtoBufJsonConverter to support WellKnownTypes (#1161)
* Use latest ProtoBufJsonConverter to support WellKnownTypes * Fix * 02 * WireMockServer_WithBodyAsProtoBuf_WithWellKnownTypes * . * extra test * 0.4.0-preview-06 * 7 * <PackageReference Include="ProtoBufJsonConverter" Version="0.4.0-preview-08" /> * Update README.md * <PackageReference Include="ProtoBufJsonConverter" Version="0.4.0-preview-09" /> * <PackageReference Include="ProtoBufJsonConverter" Version="0.4.0" /> * Update README.md
- Loading branch information
Showing
34 changed files
with
530 additions
and
153 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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,59 @@ | ||
// Copyright © WireMock.Net | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace WireMock.Models; | ||
|
||
/// <summary> | ||
/// A structure defining an (optional) Id and a Text. | ||
/// </summary> | ||
public readonly struct IdOrTexts | ||
{ | ||
/// <summary> | ||
/// The Id [optional]. | ||
/// </summary> | ||
public string? Id { get; } | ||
|
||
/// <summary> | ||
/// The Text. | ||
/// </summary> | ||
public IReadOnlyList<string> Texts { get; } | ||
|
||
/// <summary> | ||
/// Create a IdOrText | ||
/// </summary> | ||
/// <param name="id">The Id [optional]</param> | ||
/// <param name="text">The Text.</param> | ||
public IdOrTexts(string? id, string text) : this(id, [text]) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Create a IdOrText | ||
/// </summary> | ||
/// <param name="id">The Id [optional]</param> | ||
/// <param name="texts">The Texts.</param> | ||
public IdOrTexts(string? id, IReadOnlyList<string> texts) | ||
{ | ||
Id = id; | ||
Texts = texts; | ||
} | ||
|
||
/// <summary> | ||
/// When Id is defined, return process the Id, else process the Texts. | ||
/// </summary> | ||
/// <param name="id">Callback to process the id.</param> | ||
/// <param name="texts">Callback to process the texts.</param> | ||
public void Value(Action<string> id, Action<IReadOnlyList<string>> texts) | ||
{ | ||
if (Id != null) | ||
{ | ||
id(Id); | ||
} | ||
else | ||
{ | ||
texts(Texts); | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.