Skip to content

Commit 28acf62

Browse files
Apply review feedback
- Remove collection expression. - Fix two typos. - Add parameter to benchmark.
1 parent 0e4c5d4 commit 28acf62

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/OpenApi/perf/Microbenchmarks/TransformersBenchmark.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void DocumentTransformerAsDelegate_Delegate()
7979
[GlobalSetup(Target = nameof(ActivatedSchemaTransformer))]
8080
public void ActivatedSchemaTransformer_Setup()
8181
{
82-
_builder.MapGet("/", () => { });
82+
_builder.MapPost("/", (Todo todo) => todo);
8383
for (var i = 0; i <= TransformerCount; i++)
8484
{
8585
_options.AddSchemaTransformer<SchemaTransformer>();

src/OpenApi/src/Services/OpenApiDocumentService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ internal sealed class OpenApiDocumentService(
4646
/// are unique within the lifetime of an application and serve as helpful associators between
4747
/// operations, API descriptions, and their respective transformer contexts.
4848
/// </summary>
49-
private readonly Dictionary<string, OpenApiOperationTransformerContext> _operationTransformerContextCache = [];
49+
private readonly Dictionary<string, OpenApiOperationTransformerContext> _operationTransformerContextCache = new();
5050
private static readonly ApiResponseType _defaultApiResponseType = new() { StatusCode = StatusCodes.Status200OK };
5151

5252
internal bool TryGetCachedOperationTransformerContext(string descriptionId, [NotNullWhen(true)] out OpenApiOperationTransformerContext? context)

src/OpenApi/src/Transformers/IOpenApiOperationTransformer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.OpenApi;
1111
public interface IOpenApiOperationTransformer
1212
{
1313
/// <summary>
14-
/// Transforms the specified OpenAPI document.
14+
/// Transforms the specified OpenAPI operation.
1515
/// </summary>
1616
/// <param name="operation">The <see cref="OpenApiOperation"/> to modify.</param>
1717
/// <param name="context">The <see cref="OpenApiOperationTransformerContext"/> associated with the <see paramref="operation"/>.</param>

src/OpenApi/src/Transformers/IOpenApiSchemaTransformer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.OpenApi;
1111
public interface IOpenApiSchemaTransformer
1212
{
1313
/// <summary>
14-
/// Transforms the specified OpenAPI document.
14+
/// Transforms the specified OpenAPI schema.
1515
/// </summary>
1616
/// <param name="schema">The <see cref="OpenApiSchema"/> to modify.</param>
1717
/// <param name="context">The <see cref="OpenApiSchemaTransformerContext"/> associated with the <see paramref="schema"/>.</param>

0 commit comments

Comments
 (0)