* Fix construction of path in OpenApiParser (#1265)

* Server-Sent Events (#1269)

* Server Side Events

* fixes

* await HandleSseStringAsync(responseMessage, response, bodyData);

* 1.7.5-preview-01

* IBlockingQueue

* 1.7.5-preview-02 (03 April 2025)

* IBlockingQueue

* ...

* Support OpenApi V31 (#1279)

* Support OpenApi V31

* Update src/WireMock.Net.OpenApiParser/Extensions/OpenApiSchemaExtensions.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fx

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add ProtoDefinitionHelper.FromDirectory (#1263)

* Add ProtoDefinitionHelper.FromDirectory

* .

* unix-windows

* move test

* imports in the proto files indeed should use a forward slash

* updates

* .

* private Func<IdOrTexts> ProtoDefinitionFunc()

* OpenTelemetry

* .

* fix path utils

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Stef Heyenrath
2025-04-23 11:51:44 +02:00
committed by GitHub
parent fc0f82db33
commit 4368e3cde6
66 changed files with 3275 additions and 1002 deletions

View File

@@ -0,0 +1,40 @@
// Copyright © WireMock.Net
#if !(NET452 || NET461 || NETCOREAPP3_1)
using FluentAssertions;
using WireMock.Net.OpenApiParser.Utils;
using Xunit;
namespace WireMock.Net.Tests.OpenApiParser;
public class PathUtilsTests
{
[Theory]
[InlineData(new string[] { }, "")]
[InlineData(new[] { "path1" }, "path1")]
[InlineData(new[] { "/path1" }, "/path1")]
[InlineData(new[] { "/path1/" }, "/path1")]
public void Combine_ShouldReturnCombinedPathTest1(string[] paths, string expected)
{
// Act
var result = PathUtils.Combine(paths);
// Assert
result.Should().Be(expected);
}
[Theory]
[InlineData("/path1", "path2")]
[InlineData("/path1/", "path2")]
[InlineData("/path1", "/path2")]
[InlineData("/path1", "path2/")]
public void Combine_ShouldReturnCombinedPathTest2(params string[] paths)
{
// Act
var result = PathUtils.Combine(paths);
// Assert
result.Should().Be("/path1/path2");
}
}
#endif

View File

@@ -334,7 +334,7 @@
"processingTerminalId": "example-string",
"order": {
"orderId": "example-string",
"dateTime": "2024-06-19T12:34:56.000+00:00",
"dateTime": "2024-06-19T12:34:56.000\u002B00:00",
"description": "example-string",
"amount": 42,
"currency": "AED",
@@ -1787,7 +1787,7 @@
"processingTerminalId": "example-string",
"order": {
"orderId": "example-string",
"dateTime": "2024-06-19T12:34:56.000+00:00",
"dateTime": "2024-06-19T12:34:56.000\u002B00:00",
"description": "example-string",
"amount": 42,
"currency": "AED"
@@ -2714,7 +2714,7 @@
"processingTerminalId": "example-string",
"order": {
"orderId": "example-string",
"dateTime": "2024-06-19T12:34:56.000+00:00",
"dateTime": "2024-06-19T12:34:56.000\u002B00:00",
"description": "example-string",
"amount": 42,
"currency": "AED",
@@ -2863,7 +2863,7 @@
"processingTerminalId": "example-string",
"order": {
"orderId": "example-string",
"dateTime": "2024-06-19T12:34:56.000+00:00",
"dateTime": "2024-06-19T12:34:56.000\u002B00:00",
"description": "example-string",
"amount": 42,
"currency": "AED"
@@ -6893,7 +6893,7 @@
"operator": "example-string",
"order": {
"orderId": "example-string",
"dateTime": "2024-06-19T12:34:56.000+00:00",
"dateTime": "2024-06-19T12:34:56.000\u002B00:00",
"description": "example-string",
"amount": 42,
"currency": "AED",
@@ -7093,7 +7093,7 @@
"offlineProcessing": {
"operation": "offlineDecline",
"approvalCode": "example-string",
"dateTime": "2024-06-19T12:34:56.000+00:00"
"dateTime": "2024-06-19T12:34:56.000\u002B00:00"
},
"autoCapture": true,
"processAsSale": true
@@ -11349,7 +11349,7 @@
{
"op": "replace",
"path": "/a/b/c",
"value": "42"
"value": 420
},
{
"op": "move",
@@ -11827,7 +11827,7 @@
{
"op": "replace",
"path": "/a/b/c",
"value": "42"
"value": 420
},
{
"op": "move",
@@ -12541,7 +12541,7 @@
{
"op": "replace",
"path": "/a/b/c",
"value": "42"
"value": 420
},
{
"op": "move",
@@ -12986,7 +12986,7 @@
"operator": "example-string",
"order": {
"orderId": "example-string",
"dateTime": "2024-06-19T12:34:56.000+00:00",
"dateTime": "2024-06-19T12:34:56.000\u002B00:00",
"description": "example-string",
"amount": 42,
"currency": "AED",

View File

@@ -13,6 +13,7 @@ namespace WireMock.Net.Tests.OpenApiParser;
[UsesVerify]
public class WireMockOpenApiParserTests
{
private readonly DateTime _exampleDateTime = new(2024, 6, 19, 12, 34, 56, DateTimeKind.Utc);
private readonly Mock<IWireMockOpenApiParserExampleValues> _exampleValuesMock = new();
private readonly WireMockOpenApiParser _sut = new();
@@ -22,12 +23,12 @@ public class WireMockOpenApiParserTests
_exampleValuesMock.SetupGet(e => e.Boolean).Returns(true);
_exampleValuesMock.SetupGet(e => e.Integer).Returns(42);
_exampleValuesMock.SetupGet(e => e.Float).Returns(1.1f);
_exampleValuesMock.SetupGet(e => e.Double).Returns(2.2d);
_exampleValuesMock.SetupGet(e => e.Decimal).Returns(2.2m);
_exampleValuesMock.SetupGet(e => e.String).Returns("example-string");
_exampleValuesMock.SetupGet(e => e.Object).Returns("example-object");
_exampleValuesMock.SetupGet(e => e.Bytes).Returns("Stef"u8.ToArray());
_exampleValuesMock.SetupGet(e => e.Date).Returns(() => new DateTime(2024, 6, 19));
_exampleValuesMock.SetupGet(e => e.DateTime).Returns(() => new DateTime(2024, 6, 19, 12, 34, 56, DateTimeKind.Utc));
_exampleValuesMock.SetupGet(e => e.Date).Returns(() => _exampleDateTime.Date);
_exampleValuesMock.SetupGet(e => e.DateTime).Returns(() => _exampleDateTime);
}
[Fact]

View File

@@ -8,7 +8,7 @@ info:
url: https://docs.payroc.com/api
email: helpdesk@payroc.com
servers:
- url: https://api.payroc.com/v1
- url: https://api.payroc.com/v1/
description: External URL
security:
- bearerAuth: []
@@ -3734,7 +3734,7 @@ paths:
path: /a/b/c
- op: replace
path: /a/b/c
value: 42
value: 420
- op: move
from: /a/b/c
path: /a/b/d