Skip to content

Commit 1bbe001

Browse files
Bump the microsoft-openapi group with 1 update (#3764)
* Bump the microsoft-openapi group with 1 update Bumps microsoft.openapi.kiota from 1.29.0 to 1.30.0 --- updated-dependencies: - dependency-name: microsoft.openapi.kiota dependency-version: 1.30.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: microsoft-openapi ... Signed-off-by: dependabot[bot] <support@github.com> * Update Kiota snapshot Update snapshot for Kiota client generation test. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: martincostello <martin@martincostello.com>
1 parent c0b6a3a commit 1bbe001

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"rollForward": false
2525
},
2626
"microsoft.openapi.kiota": {
27-
"version": "1.29.0",
27+
"version": "1.30.0",
2828
"commands": [
2929
"kiota"
3030
],

test/Swashbuckle.AspNetCore.IntegrationTests/CodeGenerationTests.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,19 @@ await VerifyDirectory(
7979
include: (p) => !p.Contains("bin") && !p.Contains("obj"),
8080
options: new() { RecurseSubdirectories = true })
8181
.UseDirectory("snapshots")
82-
.UseFileName($"{nameof(GeneratesValidClient)}_{hashString}");
82+
.UseFileName($"{nameof(GeneratesValidClient)}_{hashString}")
83+
.AddScrubber((builder) =>
84+
{
85+
var content = builder.ToString();
86+
int start = content.IndexOf("RequestAdapter.BaseUrl = \"file://");
87+
if (start >= 0)
88+
{
89+
int end = content.IndexOf(';', start);
90+
builder.Replace(
91+
content[start..(end + 1)],
92+
"RequestAdapter.BaseUrl = \"file://{TempPath}\";");
93+
}
94+
});
8395
}
8496

8597
[Fact]

test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/GeneratesValidClient_484a86c0761779e7/KiotaOpenApiClient.verified.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public partial class KiotaOpenApiClient : BaseRequestBuilder
3737
ApiClientBuilder.RegisterDefaultDeserializer<JsonParseNodeFactory>();
3838
ApiClientBuilder.RegisterDefaultDeserializer<TextParseNodeFactory>();
3939
ApiClientBuilder.RegisterDefaultDeserializer<FormParseNodeFactory>();
40+
if (string.IsNullOrEmpty(RequestAdapter.BaseUrl))
41+
{
42+
RequestAdapter.BaseUrl = "file://{TempPath}";
43+
}
44+
PathParameters.TryAdd("baseurl", RequestAdapter.BaseUrl);
4045
}
4146
}
4247
}

0 commit comments

Comments
 (0)