Skip to content

Commit 66fbf8e

Browse files
Use WithSummary()
Use the new WithSummary() extension method.
1 parent 1983398 commit 66fbf8e

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

src/API/ApiModule.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static IEndpointRouteBuilder MapApiEndpoints(this IEndpointRouteBuilder b
6262
.Produces<TimeResponse, TimeResponseExampleProvider>("The current UTC date and time.")
6363
.RequireCors("DefaultCorsPolicy")
6464
.WithName("Time")
65-
.WithOperationDescription("Gets the current UTC time.");
65+
.WithSummary("Gets the current UTC time.");
6666

6767
builder.MapGet("/tools/guid", (
6868
[SwaggerParameterExample("The format for which to generate a GUID.", "D")] string? format,
@@ -89,7 +89,7 @@ public static IEndpointRouteBuilder MapApiEndpoints(this IEndpointRouteBuilder b
8989
.Produces<GuidResponse, GuidResponseExampleProvider>("A GUID was generated successfully.")
9090
.ProducesProblem("The specified format is invalid.")
9191
.WithName("Guid")
92-
.WithOperationDescription("Generates a GUID.")
92+
.WithSummary("Generates a GUID.")
9393
.WithProblemDetailsResponseExample();
9494

9595
builder.MapPost("/tools/hash", (HashRequest? request) =>
@@ -163,7 +163,7 @@ public static IEndpointRouteBuilder MapApiEndpoints(this IEndpointRouteBuilder b
163163
.Produces<HashResponse, HashResponseExampleProvider>("The hash was generated successfully.")
164164
.ProducesProblem("The specified hash algorithm or output format is invalid.")
165165
.WithName("Hash")
166-
.WithOperationDescription("Generates a hash of some plaintext for a specified hash algorithm and returns it in the required format.")
166+
.WithSummary("Generates a hash of some plaintext for a specified hash algorithm and returns it in the required format.")
167167
.WithProblemDetailsResponseExample();
168168

169169
builder.MapGet("/tools/machinekey", (
@@ -204,7 +204,7 @@ public static IEndpointRouteBuilder MapApiEndpoints(this IEndpointRouteBuilder b
204204
.Produces<MachineKeyResponse, MachineKeyResponseExampleProvider>("The machine key was generated successfully.")
205205
.ProducesProblem("The specified decryption or validation algorithm is invalid.")
206206
.WithName("MachineKey")
207-
.WithOperationDescription("Generates a machine key for a Web.config configuration file for ASP.NET.")
207+
.WithSummary("Generates a machine key for a Web.config configuration file for ASP.NET.")
208208
.WithProblemDetailsResponseExample();
209209

210210
return builder;

src/API/Extensions/RouteHandlerBuilderExtensions.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,6 @@ internal static RouteHandlerBuilder ProducesProblem(
100100
"application/problem+json");
101101
}
102102

103-
/// <summary>
104-
/// Adds the <see cref="SwaggerOperationAttribute"/> to the metadata for all builders produced by builder.
105-
/// </summary>
106-
/// <param name="builder">The <see cref="RouteHandlerBuilder"/>.</param>
107-
/// <param name="summary">The operation summary.</param>
108-
/// <param name="description">The optional operation description.</param>
109-
/// <returns>
110-
/// A <see cref="RouteHandlerBuilder"/> that can be used to further customize the endpoint.
111-
/// </returns>
112-
internal static RouteHandlerBuilder WithOperationDescription(
113-
this RouteHandlerBuilder builder,
114-
string summary,
115-
string? description = null)
116-
{
117-
return builder.WithMetadata(new SwaggerOperationAttribute(summary, description));
118-
}
119-
120103
/// <summary>
121104
/// Adds the <see cref="SwaggerResponseExampleAttribute"/> for <see cref="ProblemDetails"/> to the metadata for all builders produced by builder.
122105
/// </summary>

0 commit comments

Comments
 (0)