Skip to content

Commit eceb7a5

Browse files
committed
Fix up comments and CancellationToken pass through
1 parent 283ccef commit eceb7a5

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/OpenApi/src/Services/OpenApiDocumentService.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ internal OpenApiInfo GetOpenApiInfo()
9999
/// the object to support filtering each
100100
/// description instance into its appropriate document.
101101
/// </remarks>
102-
private async Task<OpenApiPaths> GetOpenApiPathsAsync(HashSet<OpenApiTag> capturedTags, CancellationToken cancellationToken = default)
102+
private async Task<OpenApiPaths> GetOpenApiPathsAsync(HashSet<OpenApiTag> capturedTags, CancellationToken cancellationToken)
103103
{
104104
var descriptionsByPath = apiDescriptionGroupCollectionProvider.ApiDescriptionGroups.Items
105105
.SelectMany(group => group.Items)
@@ -114,7 +114,7 @@ private async Task<OpenApiPaths> GetOpenApiPathsAsync(HashSet<OpenApiTag> captur
114114
return paths;
115115
}
116116

117-
private async Task<Dictionary<OperationType, OpenApiOperation>> GetOperationsAsync(IGrouping<string?, ApiDescription> descriptions, HashSet<OpenApiTag> capturedTags, CancellationToken cancellationToken = default)
117+
private async Task<Dictionary<OperationType, OpenApiOperation>> GetOperationsAsync(IGrouping<string?, ApiDescription> descriptions, HashSet<OpenApiTag> capturedTags, CancellationToken cancellationToken)
118118
{
119119
var operations = new Dictionary<OperationType, OpenApiOperation>();
120120
foreach (var description in descriptions)
@@ -132,7 +132,7 @@ private async Task<Dictionary<OperationType, OpenApiOperation>> GetOperationsAsy
132132
return operations;
133133
}
134134

135-
private async Task<OpenApiOperation> GetOperationAsync(ApiDescription description, HashSet<OpenApiTag> capturedTags, CancellationToken cancellationToken = default)
135+
private async Task<OpenApiOperation> GetOperationAsync(ApiDescription description, HashSet<OpenApiTag> capturedTags, CancellationToken cancellationToken)
136136
{
137137
var tags = GetTags(description);
138138
if (tags != null)
@@ -177,7 +177,7 @@ private async Task<OpenApiOperation> GetOperationAsync(ApiDescription descriptio
177177
return [new OpenApiTag { Name = description.ActionDescriptor.RouteValues["controller"] }];
178178
}
179179

180-
private async Task<OpenApiResponses> GetResponsesAsync(ApiDescription description, CancellationToken cancellationToken = default)
180+
private async Task<OpenApiResponses> GetResponsesAsync(ApiDescription description, CancellationToken cancellationToken)
181181
{
182182
// OpenAPI requires that each operation have a response, usually a successful one.
183183
// if there are no response types defined, we assume a successful 200 OK response
@@ -205,7 +205,7 @@ private async Task<OpenApiResponses> GetResponsesAsync(ApiDescription descriptio
205205
return responses;
206206
}
207207

208-
private async Task<OpenApiResponse> GetResponseAsync(ApiDescription apiDescription, int statusCode, ApiResponseType apiResponseType, CancellationToken cancellationToken = default)
208+
private async Task<OpenApiResponse> GetResponseAsync(ApiDescription apiDescription, int statusCode, ApiResponseType apiResponseType, CancellationToken cancellationToken)
209209
{
210210
var description = ReasonPhrases.GetReasonPhrase(statusCode);
211211
var response = new OpenApiResponse
@@ -240,7 +240,7 @@ private async Task<OpenApiResponse> GetResponseAsync(ApiDescription apiDescripti
240240
return response;
241241
}
242242

243-
private async Task<List<OpenApiParameter>?> GetParametersAsync(ApiDescription description, CancellationToken cancellationToken = default)
243+
private async Task<List<OpenApiParameter>?> GetParametersAsync(ApiDescription description, CancellationToken cancellationToken)
244244
{
245245
List<OpenApiParameter>? parameters = null;
246246
foreach (var parameter in description.ParameterDescriptions)
@@ -273,7 +273,7 @@ private async Task<OpenApiResponse> GetResponseAsync(ApiDescription apiDescripti
273273
return parameters;
274274
}
275275

276-
private async Task<OpenApiRequestBody?> GetRequestBodyAsync(ApiDescription description, CancellationToken cancellationToken = default)
276+
private async Task<OpenApiRequestBody?> GetRequestBodyAsync(ApiDescription description, CancellationToken cancellationToken)
277277
{
278278
// Only one parameter can be bound from the body in each request.
279279
if (description.TryGetBodyParameter(out var bodyParameter))
@@ -290,7 +290,7 @@ private async Task<OpenApiResponse> GetResponseAsync(ApiDescription apiDescripti
290290
return null;
291291
}
292292

293-
private async Task<OpenApiRequestBody> GetFormRequestBody(IList<ApiRequestFormat> supportedRequestFormats, IEnumerable<ApiParameterDescription> formParameters, CancellationToken cancellationToken = default)
293+
private async Task<OpenApiRequestBody> GetFormRequestBody(IList<ApiRequestFormat> supportedRequestFormats, IEnumerable<ApiParameterDescription> formParameters, CancellationToken cancellationToken)
294294
{
295295
if (supportedRequestFormats.Count == 0)
296296
{
@@ -415,7 +415,7 @@ private async Task<OpenApiRequestBody> GetFormRequestBody(IList<ApiRequestFormat
415415
return requestBody;
416416
}
417417

418-
private async Task<OpenApiRequestBody> GetJsonRequestBody(IList<ApiRequestFormat> supportedRequestFormats, ApiParameterDescription bodyParameter, CancellationToken cancellationToken = default)
418+
private async Task<OpenApiRequestBody> GetJsonRequestBody(IList<ApiRequestFormat> supportedRequestFormats, ApiParameterDescription bodyParameter, CancellationToken cancellationToken)
419419
{
420420
if (supportedRequestFormats.Count == 0)
421421
{

src/OpenApi/src/Services/OpenApiOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public OpenApiOptions UseOperationTransformer(Func<OpenApiOperation, OpenApiOper
9292
}
9393

9494
/// <summary>
95-
/// Registers a given delegate as an schema transformer on the current <see cref="OpenApiOptions"/> instance.
95+
/// Registers a given delegate as a schema transformer on the current <see cref="OpenApiOptions"/> instance.
9696
/// </summary>
9797
/// <param name="transformer">The delegate representing the schema transformer.</param>
9898
/// <returns>The <see cref="OpenApiOptions"/> instance for further customization.</returns>

src/OpenApi/src/Transformers/OpenApiSchemaTransformerContext.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ public sealed class OpenApiSchemaTransformerContext
1919
/// <summary>
2020
/// Gets the <see cref="Type" /> associated with the current <see cref="OpenApiSchema"/>
2121
/// </summary>
22-
/// <value></value>
2322
public required Type Type { get; init; }
2423

2524
/// <summary>
26-
/// Gets the <see cref="ApiParameterDescription"/> associated with target schema.
25+
/// Gets the <see cref="ApiParameterDescription"/> associated with target schema.
2726
/// Null when processing an OpenAPI schema for a response type.
2827
/// </summary>
2928
public required ApiParameterDescription? ParameterDescription { get; init; }

0 commit comments

Comments
 (0)