Skip to content

Commit e186311

Browse files
Apply code review suggestions
- Update comments. - Update Copilot style suggestion.
1 parent b1f558a commit e186311

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/OpenApi/src/Extensions/ApiDescriptionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ internal static class ApiDescriptionExtensions
2020
public static HttpMethod? GetHttpMethod(this ApiDescription apiDescription) =>
2121
apiDescription.HttpMethod?.ToUpperInvariant() switch
2222
{
23+
// Only add methods documented in the OpenAPI spec: https://spec.openapis.org/oas/v3.1.1.html#path-item-object
2324
"GET" => HttpMethod.Get,
2425
"POST" => HttpMethod.Post,
2526
"PUT" => HttpMethod.Put,
@@ -28,7 +29,6 @@ internal static class ApiDescriptionExtensions
2829
"HEAD" => HttpMethod.Head,
2930
"OPTIONS" => HttpMethod.Options,
3031
"TRACE" => HttpMethod.Trace,
31-
"QUERY" => null, // OpenAPI as of 3.1 does not yet support HTTP QUERY
3232
_ => null,
3333
};
3434

src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/OpenApiDocumentIntegrationTests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ public async Task OpenApiDocumentIsValid(string documentName, OpenApiSpecVersion
6868
Assert.Empty(errors);
6969
}
7070

71-
// The test below can be removed when https://github.com/microsoft/OpenAPI.NET/issues/2453 is implemented
72-
7371
[Theory] // See https://github.com/dotnet/aspnetcore/issues/63090
7472
[MemberData(nameof(OpenApiDocuments))]
7573
public async Task OpenApiDocumentReferencesAreValid(string documentName, OpenApiSpecVersion version)
@@ -103,6 +101,7 @@ private async Task<string> GetOpenApiDocument(string documentName, OpenApiSpecVe
103101
var documentService = fixture.Services.GetRequiredKeyedService<OpenApiDocumentService>(documentName);
104102
var scopedServiceProvider = fixture.Services.CreateScope();
105103
var document = await documentService.GetOpenApiDocumentAsync(scopedServiceProvider.ServiceProvider);
104+
106105
return await document.SerializeAsJsonAsync(version);
107106
}
108107

0 commit comments

Comments
 (0)