mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-17 07:36:47 +01:00
Update Scriban.Signed to version 5.5.0 (#777)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Scriban;
|
||||
using Scriban.Parsing;
|
||||
@@ -50,6 +50,20 @@ namespace WireMock.Transformers.Scriban
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TryGetItem(TemplateContext context, SourceSpan span, object target, object index, out object value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TrySetItem(TemplateContext context, SourceSpan span, object target, object index, object value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool HasIndexer => throw new NotImplementedException();
|
||||
|
||||
public Type IndexType => throw new NotImplementedException();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
using Scriban;
|
||||
using Scriban;
|
||||
using Scriban.Runtime;
|
||||
using WireMock.Types;
|
||||
|
||||
namespace WireMock.Transformers.Scriban
|
||||
{
|
||||
internal class WireMockTemplateContext: TemplateContext
|
||||
{
|
||||
protected override IObjectAccessor GetMemberAccessorImpl(object target)
|
||||
{
|
||||
if (target?.GetType().GetGenericTypeDefinition() == typeof(WireMockList<>))
|
||||
{
|
||||
return new WireMockListAccessor();
|
||||
}
|
||||
namespace WireMock.Transformers.Scriban;
|
||||
|
||||
return base.GetMemberAccessorImpl(target);
|
||||
}
|
||||
internal class WireMockTemplateContext : TemplateContext
|
||||
{
|
||||
protected override IObjectAccessor GetMemberAccessorImpl(object target)
|
||||
{
|
||||
return target?.GetType().GetGenericTypeDefinition() == typeof(WireMockList<>) ?
|
||||
new WireMockListAccessor() :
|
||||
base.GetMemberAccessorImpl(target);
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' ">
|
||||
<PackageReference Include="Scriban.Signed" Version="3.3.2" />
|
||||
<PackageReference Include="Scriban.Signed" Version="5.5.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
|
||||
<PackageReference Include="Nullable" Version="1.3.0" />
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' or '$(TargetFramework)' == 'net6.0' ">
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Scriban.Signed" Version="3.3.2" />
|
||||
<PackageReference Include="Scriban.Signed" Version="5.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -41,7 +41,7 @@ public class CustomPathParamMatcher : IStringMatcher
|
||||
MatchOperator = matchOperator;
|
||||
}
|
||||
|
||||
public double IsMatch(string input)
|
||||
public double IsMatch(string? input)
|
||||
{
|
||||
var inputParts = GetPathParts(input);
|
||||
if (inputParts.Length != _pathParts.Length)
|
||||
@@ -97,8 +97,13 @@ public class CustomPathParamMatcher : IStringMatcher
|
||||
|
||||
public MatchOperator MatchOperator { get; }
|
||||
|
||||
private static string[] GetPathParts(string path)
|
||||
private static string[] GetPathParts(string? path)
|
||||
{
|
||||
if (path is null)
|
||||
{
|
||||
return new string[0];
|
||||
}
|
||||
|
||||
var hashMarkIndex = path.IndexOf('#');
|
||||
if (hashMarkIndex != -1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user