-
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Transformer functionality to return value instead of string (#858
- Loading branch information
Showing
25 changed files
with
673 additions
and
540 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
47 changes: 18 additions & 29 deletions
47
src/WireMock.Net.Abstractions/Types/ReplaceNodeOptions.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 |
---|---|---|
@@ -1,36 +1,25 @@ | ||
using System; | ||
namespace WireMock.Types; | ||
|
||
namespace WireMock.Types | ||
/// <summary> | ||
/// Logic to use when replace a JSON node using the Transformer. | ||
/// </summary> | ||
public enum ReplaceNodeOptions | ||
{ | ||
/// <summary> | ||
/// Flags to use when replace a JSON node using the Transformer. | ||
/// Try to evaluate a templated value. | ||
/// In case this is valid, return the value and if the value can be converted to a primitive type, use that value. | ||
/// </summary> | ||
[Flags] | ||
public enum ReplaceNodeOptions | ||
{ | ||
/// <summary> | ||
/// Default | ||
/// </summary> | ||
None = 0 | ||
EvaluateAndTryToConvert = 0, | ||
|
||
///// <summary> | ||
///// Replace boolean string value to a real boolean value. (This is used by default to maintain backward compatibility.) | ||
///// </summary> | ||
//Bool = 0b00000001, | ||
|
||
///// <summary> | ||
///// Replace integer string value to a real integer value. | ||
///// </summary> | ||
//Integer = 0b00000010, | ||
|
||
///// <summary> | ||
///// Replace long string value to a real long value. | ||
///// </summary> | ||
//Long = 0b00000100, | ||
/// <summary> | ||
/// Try to evaluate a templated value. | ||
/// In case this is valid, return the value, else fallback to the parse behavior. | ||
/// </summary> | ||
Evaluate = 1, | ||
|
||
///// <summary> | ||
///// Replace all string values to a real values. | ||
///// </summary> | ||
//All = Bool | Integer | Long | ||
} | ||
/// <summary> | ||
/// Parse templated string to a templated string. | ||
/// (keep a templated string value as string value). | ||
/// </summary> | ||
Parse = 2 | ||
} |
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 |
---|---|---|
@@ -1,23 +1,22 @@ | ||
namespace WireMock.Types | ||
namespace WireMock.Types; | ||
|
||
/// <summary> | ||
/// The ResponseMessage Transformers | ||
/// </summary> | ||
public enum TransformerType | ||
{ | ||
/// <summary> | ||
/// The ResponseMessage Transformers | ||
/// https://github.com/Handlebars-Net/Handlebars.Net | ||
/// </summary> | ||
public enum TransformerType | ||
{ | ||
/// <summary> | ||
/// https://github.com/Handlebars-Net/Handlebars.Net | ||
/// </summary> | ||
Handlebars, | ||
Handlebars, | ||
|
||
/// <summary> | ||
/// https://github.com/scriban/scriban : default | ||
/// </summary> | ||
Scriban, | ||
/// <summary> | ||
/// https://github.com/scriban/scriban : default | ||
/// </summary> | ||
Scriban, | ||
|
||
/// <summary> | ||
/// https://github.com/scriban/scriban : DotLiquid | ||
/// </summary> | ||
ScribanDotLiquid | ||
} | ||
/// <summary> | ||
/// https://github.com/scriban/scriban : DotLiquid | ||
/// </summary> | ||
ScribanDotLiquid | ||
} |
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.