Compare commits

..

2 Commits
1.5.2 ... 1.5.3

Author SHA1 Message Date
Stef Heyenrath
be4b0addca 1.5.3 2022-07-29 13:21:22 +02:00
Stef Heyenrath
ae91ed2a79 Update Scriban.Signed to version 5.5.0 (#777) 2022-07-29 13:18:23 +02:00
8 changed files with 42 additions and 24 deletions

View File

@@ -1,3 +1,7 @@
# 1.5.3 (29 July 2022)
- [#777](https://github.com/WireMock-Net/WireMock.Net/pull/777) - Update Scriban.Signed to version 5.5.0 [feature] contributed by [StefH](https://github.com/StefH)
- [#776](https://github.com/WireMock-Net/WireMock.Net/issues/776) - Update Scriban.Signed to support more functions, e.g math.random [feature]
# 1.5.2 (24 July 2022)
- [#769](https://github.com/WireMock-Net/WireMock.Net/pull/769) - Bump Microsoft.AspNetCore.Server.Kestrel.Core from 2.1.3 to 2.1.7 in /examples/WireMock.Net.StandAlone.Net461 [dependencies] contributed by [dependabot[bot]](https://github.com/apps/dependabot)
- [#770](https://github.com/WireMock-Net/WireMock.Net/pull/770) - Added some more tests for JsonMatcher + refactored some code to use nullable [test] contributed by [StefH](https://github.com/StefH)

View File

@@ -4,7 +4,7 @@
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>1.5.2</VersionPrefix>
<VersionPrefix>1.5.3</VersionPrefix>
<PackageIcon>WireMock.Net-Logo.png</PackageIcon>
<PackageProjectUrl>https://github.com/WireMock-Net/WireMock.Net</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>

View File

@@ -1,6 +1,6 @@
rem https://github.com/StefH/GitHubReleaseNotes
SET version=1.5.2
SET version=1.5.3
GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels question invalid doc duplicate --version %version% --token %GH_TOKEN%

View File

@@ -1,6 +1,5 @@
# 1.5.2 (24 July 2022)
- #769 Bump Microsoft.AspNetCore.Server.Kestrel.Core from 2.1.3 to 2.1.7 in /examples/WireMock.Net.StandAlone.Net461 [dependencies]
- #770 Added some more tests for JsonMatcher + refactored some code to use nullable [test]
- #771 JsonPartialMatcher - support Regex [feature]
# 1.5.3 (29 July 2022)
- #777 Update Scriban.Signed to version 5.5.0 [feature]
- #776 Update Scriban.Signed to support more functions, e.g math.random [feature]
The full release notes can be found here: https://github.com/WireMock-Net/WireMock.Net/blob/master/CHANGELOG.md

View File

@@ -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
}
}

View File

@@ -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);
}
}

View File

@@ -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>

View File

@@ -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)
{