Skip to content

Commit efee8b3

Browse files
committed
test(openapi31): add integration test for openapi 3.1
1 parent d257b09 commit efee8b3

15 files changed

Lines changed: 509 additions & 0 deletions

OpenAPI.WebApiGenerator.sln

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,120 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "root", "root", "{F4FDC271-0
1919
LICENSE = LICENSE
2020
EndProjectSection
2121
EndProject
22+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.OpenApi31", "tests\Example.OpenApi31\Example.OpenApi31.csproj", "{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}"
23+
EndProject
24+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Example.OpenApi31.IntegrationTests", "tests\Example.OpenApi31.IntegrationTests\Example.OpenApi31.IntegrationTests.csproj", "{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}"
25+
EndProject
2226
Global
2327
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2428
Debug|Any CPU = Debug|Any CPU
29+
Debug|x64 = Debug|x64
30+
Debug|x86 = Debug|x86
2531
Release|Any CPU = Release|Any CPU
32+
Release|x64 = Release|x64
33+
Release|x86 = Release|x86
2634
EndGlobalSection
2735
GlobalSection(ProjectConfigurationPlatforms) = postSolution
2836
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2937
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Debug|x64.ActiveCfg = Debug|Any CPU
39+
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Debug|x64.Build.0 = Debug|Any CPU
40+
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Debug|x86.ActiveCfg = Debug|Any CPU
41+
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Debug|x86.Build.0 = Debug|Any CPU
3042
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Release|Any CPU.ActiveCfg = Release|Any CPU
3143
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Release|Any CPU.Build.0 = Release|Any CPU
44+
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Release|x64.ActiveCfg = Release|Any CPU
45+
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Release|x64.Build.0 = Release|Any CPU
46+
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Release|x86.ActiveCfg = Release|Any CPU
47+
{E2935A8A-ED91-4A1D-BEF4-08D916A7ED07}.Release|x86.Build.0 = Release|Any CPU
3248
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3349
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Debug|Any CPU.Build.0 = Debug|Any CPU
50+
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Debug|x64.ActiveCfg = Debug|Any CPU
51+
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Debug|x64.Build.0 = Debug|Any CPU
52+
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Debug|x86.ActiveCfg = Debug|Any CPU
53+
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Debug|x86.Build.0 = Debug|Any CPU
3454
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Release|Any CPU.ActiveCfg = Release|Any CPU
3555
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Release|Any CPU.Build.0 = Release|Any CPU
56+
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Release|x64.ActiveCfg = Release|Any CPU
57+
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Release|x64.Build.0 = Release|Any CPU
58+
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Release|x86.ActiveCfg = Release|Any CPU
59+
{790AE9B7-F3EA-459C-BAB2-D75E903D9B39}.Release|x86.Build.0 = Release|Any CPU
3660
{2A585540-1B80-4848-9A93-E0286758E2E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3761
{2A585540-1B80-4848-9A93-E0286758E2E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
62+
{2A585540-1B80-4848-9A93-E0286758E2E0}.Debug|x64.ActiveCfg = Debug|Any CPU
63+
{2A585540-1B80-4848-9A93-E0286758E2E0}.Debug|x64.Build.0 = Debug|Any CPU
64+
{2A585540-1B80-4848-9A93-E0286758E2E0}.Debug|x86.ActiveCfg = Debug|Any CPU
65+
{2A585540-1B80-4848-9A93-E0286758E2E0}.Debug|x86.Build.0 = Debug|Any CPU
3866
{2A585540-1B80-4848-9A93-E0286758E2E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
3967
{2A585540-1B80-4848-9A93-E0286758E2E0}.Release|Any CPU.Build.0 = Release|Any CPU
68+
{2A585540-1B80-4848-9A93-E0286758E2E0}.Release|x64.ActiveCfg = Release|Any CPU
69+
{2A585540-1B80-4848-9A93-E0286758E2E0}.Release|x64.Build.0 = Release|Any CPU
70+
{2A585540-1B80-4848-9A93-E0286758E2E0}.Release|x86.ActiveCfg = Release|Any CPU
71+
{2A585540-1B80-4848-9A93-E0286758E2E0}.Release|x86.Build.0 = Release|Any CPU
4072
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4173
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Debug|Any CPU.Build.0 = Debug|Any CPU
74+
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Debug|x64.ActiveCfg = Debug|Any CPU
75+
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Debug|x64.Build.0 = Debug|Any CPU
76+
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Debug|x86.ActiveCfg = Debug|Any CPU
77+
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Debug|x86.Build.0 = Debug|Any CPU
4278
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Release|Any CPU.ActiveCfg = Release|Any CPU
4379
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Release|Any CPU.Build.0 = Release|Any CPU
80+
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Release|x64.ActiveCfg = Release|Any CPU
81+
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Release|x64.Build.0 = Release|Any CPU
82+
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Release|x86.ActiveCfg = Release|Any CPU
83+
{8044D11A-B0D2-400A-B2A1-8C50E396073A}.Release|x86.Build.0 = Release|Any CPU
4484
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4585
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
86+
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Debug|x64.ActiveCfg = Debug|Any CPU
87+
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Debug|x64.Build.0 = Debug|Any CPU
88+
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Debug|x86.ActiveCfg = Debug|Any CPU
89+
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Debug|x86.Build.0 = Debug|Any CPU
4690
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
4791
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Release|Any CPU.Build.0 = Release|Any CPU
92+
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Release|x64.ActiveCfg = Release|Any CPU
93+
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Release|x64.Build.0 = Release|Any CPU
94+
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Release|x86.ActiveCfg = Release|Any CPU
95+
{B1C2D3E4-F5A6-47B8-9C0D-1E2F3A4B5C6D}.Release|x86.Build.0 = Release|Any CPU
4896
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4997
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
98+
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Debug|x64.ActiveCfg = Debug|Any CPU
99+
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Debug|x64.Build.0 = Debug|Any CPU
100+
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Debug|x86.ActiveCfg = Debug|Any CPU
101+
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Debug|x86.Build.0 = Debug|Any CPU
50102
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
51103
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Release|Any CPU.Build.0 = Release|Any CPU
104+
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Release|x64.ActiveCfg = Release|Any CPU
105+
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Release|x64.Build.0 = Release|Any CPU
106+
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Release|x86.ActiveCfg = Release|Any CPU
107+
{C2D3E4F5-A6B7-48C9-0D1E-2F3A4B5C6D7E}.Release|x86.Build.0 = Release|Any CPU
108+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
109+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Debug|Any CPU.Build.0 = Debug|Any CPU
110+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Debug|x64.ActiveCfg = Debug|Any CPU
111+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Debug|x64.Build.0 = Debug|Any CPU
112+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Debug|x86.ActiveCfg = Debug|Any CPU
113+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Debug|x86.Build.0 = Debug|Any CPU
114+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Release|Any CPU.ActiveCfg = Release|Any CPU
115+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Release|Any CPU.Build.0 = Release|Any CPU
116+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Release|x64.ActiveCfg = Release|Any CPU
117+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Release|x64.Build.0 = Release|Any CPU
118+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Release|x86.ActiveCfg = Release|Any CPU
119+
{FF8E3B7A-20A5-4702-871C-D8ABC6D82F09}.Release|x86.Build.0 = Release|Any CPU
120+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
121+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Debug|Any CPU.Build.0 = Debug|Any CPU
122+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Debug|x64.ActiveCfg = Debug|Any CPU
123+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Debug|x64.Build.0 = Debug|Any CPU
124+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Debug|x86.ActiveCfg = Debug|Any CPU
125+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Debug|x86.Build.0 = Debug|Any CPU
126+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Release|Any CPU.ActiveCfg = Release|Any CPU
127+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Release|Any CPU.Build.0 = Release|Any CPU
128+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Release|x64.ActiveCfg = Release|Any CPU
129+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Release|x64.Build.0 = Release|Any CPU
130+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Release|x86.ActiveCfg = Release|Any CPU
131+
{FE9CE314-77B1-4064-B4E3-F2FCE3EDB63C}.Release|x86.Build.0 = Release|Any CPU
132+
EndGlobalSection
133+
GlobalSection(SolutionProperties) = preSolution
134+
HideSolutionNode = FALSE
135+
EndGlobalSection
136+
GlobalSection(NestedProjects) = preSolution
52137
EndGlobalSection
53138
EndGlobal
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System.Net;
2+
using AwesomeAssertions;
3+
4+
namespace Example.OpenApi31.IntegrationTests;
5+
6+
public class DeleteFooTests(FooApplicationFactory app) : FooTestSpecification, IClassFixture<FooApplicationFactory>
7+
{
8+
[Fact]
9+
public async Task When_Deleting_Foo_It_Should_Return_Ok()
10+
{
11+
using var client = app.CreateClient();
12+
var result = await client.SendAsync(new HttpRequestMessage()
13+
{
14+
RequestUri = new Uri(client.BaseAddress!, "/foo/1"),
15+
Method = new HttpMethod("DELETE")
16+
}, CancellationToken);
17+
result.StatusCode.Should().Be(HttpStatusCode.OK);
18+
var responseContent = await result.Content.ReadAsByteArrayAsync(CancellationToken);
19+
responseContent.Should().BeEmpty();
20+
result.Content.Headers.ContentType.Should().BeNull();
21+
22+
result.Headers.Should().BeEmpty();
23+
}
24+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<IsPackable>false</IsPackable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="AwesomeAssertions" Version="9.2.1" />
12+
<PackageReference Include="coverlet.collector" Version="6.0.2"/>
13+
<PackageReference Include="JetBrains.Annotations" Version="2025.2.2" />
14+
<PackageReference Include="JsonPointer.Net" Version="5.3.1" />
15+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.10" />
16+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
17+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
<PrivateAssets>all</PrivateAssets>
20+
</PackageReference>
21+
<PackageReference Include="xunit.v3" Version="3.1.0" />
22+
</ItemGroup>
23+
24+
<ItemGroup>
25+
<Using Include="Xunit"/>
26+
</ItemGroup>
27+
28+
<ItemGroup>
29+
<ProjectReference Include="..\Example.OpenApi31\Example.OpenApi31.csproj" />
30+
</ItemGroup>
31+
32+
</Project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
using JetBrains.Annotations;
2+
using Microsoft.AspNetCore.Mvc.Testing;
3+
4+
namespace Example.OpenApi31.IntegrationTests;
5+
6+
[UsedImplicitly]
7+
public class FooApplicationFactory : WebApplicationFactory<Program>;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System.Text;
2+
3+
namespace Example.OpenApi31.IntegrationTests;
4+
5+
public abstract class FooTestSpecification
6+
{
7+
protected CancellationToken CancellationToken { get; } = TestContext.Current.CancellationToken;
8+
9+
protected HttpContent CreateJsonContent(string json) => new StringContent(
10+
json,
11+
encoding: Encoding.UTF8,
12+
mediaType: "application/json");
13+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Text.Json.Nodes;
2+
3+
namespace Example.OpenApi31.IntegrationTests.Http;
4+
5+
internal static class HttpContentExtensions
6+
{
7+
internal static async Task<JsonNode?> ReadAsJsonNodeAsync(this HttpContent content,
8+
CancellationToken cancellationToken) =>
9+
await JsonNode.ParseAsync(
10+
await content.ReadAsStreamAsync(cancellationToken)
11+
.ConfigureAwait(false),
12+
cancellationToken: cancellationToken)
13+
.ConfigureAwait(false);
14+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System.Text.Json.Nodes;
2+
using AwesomeAssertions;
3+
using Json.Pointer;
4+
5+
namespace Example.OpenApi31.IntegrationTests.Json;
6+
7+
internal static class JsonNodeExtensions
8+
{
9+
internal static JsonNode Evaluate(this JsonNode? node, string path)
10+
{
11+
JsonPointer.Parse(path).TryEvaluate(node, out var value).Should()
12+
.BeTrue($"because the json node should contain the property {path}");
13+
value.Should().NotBeNull($"because the property {path} should not be null");
14+
return value!;
15+
}
16+
17+
internal static T GetValue<T>(this JsonNode? node, string path)
18+
{
19+
var value = node.Evaluate(path);
20+
return value.GetValue<T>();
21+
}
22+
23+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
using System.Net;
2+
using System.Net.Http.Headers;
3+
using AwesomeAssertions;
4+
using Example.OpenApi31.IntegrationTests.Http;
5+
using Example.OpenApi31.IntegrationTests.Json;
6+
7+
namespace Example.OpenApi31.IntegrationTests;
8+
9+
public class UpdateFooTests(FooApplicationFactory app) : FooTestSpecification, IClassFixture<FooApplicationFactory>
10+
{
11+
[Fact]
12+
public async Task When_Updating_Foo_It_Should_Return_Updated_Foo()
13+
{
14+
using var client = app.CreateClient();
15+
var result = await client.SendAsync(new HttpRequestMessage()
16+
{
17+
RequestUri = new Uri(client.BaseAddress!, "/foo/1"),
18+
Method = new HttpMethod("PUT"),
19+
Content = CreateJsonContent(
20+
"""
21+
{
22+
"Name": "test"
23+
}
24+
"""),
25+
Headers =
26+
{
27+
{ "Bar", "test" }
28+
}
29+
}, CancellationToken);
30+
result.StatusCode.Should().Be(HttpStatusCode.OK);
31+
var responseContent = await result.Content.ReadAsJsonNodeAsync(CancellationToken);
32+
responseContent.Should().NotBeNull();
33+
responseContent.GetValue<string>("#/Name").Should().Be("test");
34+
result.Headers.Should().HaveCount(1);
35+
result.Headers.Should().ContainKey("Status")
36+
.WhoseValue.Should().HaveCount(1)
37+
.And.Contain("2");
38+
result.Content.Headers.ContentType.Should().Be(MediaTypeHeaderValue.Parse("application/json"));
39+
}
40+
41+
[Fact]
42+
public async Task Given_invalid_request_When_Updating_Foo_It_Should_Return_400()
43+
{
44+
using var client = app.CreateClient();
45+
var result = await client.SendAsync(new HttpRequestMessage()
46+
{
47+
RequestUri = new Uri(client.BaseAddress!, "/foo/test"),
48+
Method = new HttpMethod("PUT"),
49+
Content = CreateJsonContent(
50+
"""
51+
{
52+
"Name": "test"
53+
}
54+
"""),
55+
Headers =
56+
{
57+
{ "Bar", "test" }
58+
}
59+
}, CancellationToken);
60+
result.StatusCode.Should().Be(HttpStatusCode.BadRequest);
61+
var responseContent = await result.Content.ReadAsJsonNodeAsync(CancellationToken);
62+
responseContent.Should().NotBeNull();
63+
responseContent.AsArray().Should().HaveCount(1);
64+
responseContent.GetValue<string>("#/0/error").Should().NotBeNullOrEmpty();
65+
responseContent.GetValue<string>("#/0/name").Should().Be("https://localhost/api.json#/components/parameters/FooId/schema/type");
66+
}
67+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<RootNamespace>Example.OpenApi31</RootNamespace>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Corvus.Json.ExtendedTypes" Version="4.4.2" />
12+
<PackageReference Include="ParameterStyleParsers.OpenAPI" Version="1.4.0" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\..\src\OpenAPI.WebApiGenerator\OpenAPI.WebApiGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
17+
</ItemGroup>
18+
<ItemGroup>
19+
<AdditionalFiles Include="openapi.json" />
20+
</ItemGroup>
21+
22+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace Example.OpenApi31.Paths.FooFooId.Delete;
2+
3+
internal partial class Operation
4+
{
5+
internal partial Task<Response> HandleAsync(Request request, CancellationToken cancellationToken)
6+
{
7+
var response = new Response.OK200();
8+
return Task.FromResult<Response>(response);
9+
}
10+
}

0 commit comments

Comments
 (0)