@@ -12,17 +12,17 @@ namespace Microsoft.AspNetCore.Http
12
12
/// Extension methods for adding <see cref="Endpoint.Metadata"/> that is
13
13
/// meant to be consumed by OpenAPI libraries.
14
14
/// </summary>
15
- public static class OpenApiRouteHandlerConventionBuilderExtensions
15
+ public static class OpenApiRouteHandlerBuilderExtensions
16
16
{
17
17
private static readonly ExcludeFromDescriptionAttribute _excludeFromDescriptionMetadataAttribute = new ( ) ;
18
18
19
19
/// <summary>
20
20
/// Adds the <see cref="IExcludeFromDescriptionMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all builders
21
21
/// produced by <paramref name="builder"/>.
22
22
/// </summary>
23
- /// <param name="builder">The <see cref="RouteHandlerConventionBuilder "/>.</param>
24
- /// <returns>A <see cref="RouteHandlerConventionBuilder "/> that can be used to further customize the endpoint.</returns>
25
- public static RouteHandlerConventionBuilder ExcludeFromDescription ( this RouteHandlerConventionBuilder builder )
23
+ /// <param name="builder">The <see cref="RouteHandlerBuilder "/>.</param>
24
+ /// <returns>A <see cref="RouteHandlerBuilder "/> that can be used to further customize the endpoint.</returns>
25
+ public static RouteHandlerBuilder ExcludeFromDescription ( this RouteHandlerBuilder builder )
26
26
{
27
27
builder . WithMetadata ( _excludeFromDescriptionMetadataAttribute ) ;
28
28
@@ -34,13 +34,13 @@ public static RouteHandlerConventionBuilder ExcludeFromDescription(this RouteHan
34
34
/// produced by <paramref name="builder"/>.
35
35
/// </summary>
36
36
/// <typeparam name="TResponse">The type of the response.</typeparam>
37
- /// <param name="builder">The <see cref="RouteHandlerConventionBuilder "/>.</param>
37
+ /// <param name="builder">The <see cref="RouteHandlerBuilder "/>.</param>
38
38
/// <param name="statusCode">The response status code. Defaults to <see cref="StatusCodes.Status200OK"/>.</param>
39
39
/// <param name="contentType">The response content type. Defaults to "application/json".</param>
40
40
/// <param name="additionalContentTypes">Additional response content types the endpoint produces for the supplied status code.</param>
41
- /// <returns>A <see cref="RouteHandlerConventionBuilder "/> that can be used to further customize the endpoint.</returns>
41
+ /// <returns>A <see cref="RouteHandlerBuilder "/> that can be used to further customize the endpoint.</returns>
42
42
#pragma warning disable RS0026
43
- public static RouteHandlerConventionBuilder Produces < TResponse > ( this RouteHandlerConventionBuilder builder ,
43
+ public static RouteHandlerBuilder Produces < TResponse > ( this RouteHandlerBuilder builder ,
44
44
#pragma warning restore RS0026
45
45
int statusCode = StatusCodes . Status200OK ,
46
46
string ? contentType = null ,
@@ -53,14 +53,14 @@ public static RouteHandlerConventionBuilder Produces<TResponse>(this RouteHandle
53
53
/// Adds an <see cref="IProducesResponseTypeMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all builders
54
54
/// produced by <paramref name="builder"/>.
55
55
/// </summary>
56
- /// <param name="builder">The <see cref="RouteHandlerConventionBuilder "/>.</param>
56
+ /// <param name="builder">The <see cref="RouteHandlerBuilder "/>.</param>
57
57
/// <param name="statusCode">The response status code.</param>
58
58
/// <param name="responseType">The type of the response. Defaults to null.</param>
59
59
/// <param name="contentType">The response content type. Defaults to "application/json" if responseType is not null, otherwise defaults to null.</param>
60
60
/// <param name="additionalContentTypes">Additional response content types the endpoint produces for the supplied status code.</param>
61
- /// <returns>A <see cref="RouteHandlerConventionBuilder "/> that can be used to further customize the endpoint.</returns>
61
+ /// <returns>A <see cref="RouteHandlerBuilder "/> that can be used to further customize the endpoint.</returns>
62
62
#pragma warning disable RS0026
63
- public static RouteHandlerConventionBuilder Produces ( this RouteHandlerConventionBuilder builder ,
63
+ public static RouteHandlerBuilder Produces ( this RouteHandlerBuilder builder ,
64
64
#pragma warning restore RS0026
65
65
int statusCode ,
66
66
Type ? responseType = null ,
@@ -87,11 +87,11 @@ public static RouteHandlerConventionBuilder Produces(this RouteHandlerConvention
87
87
/// Adds an <see cref="IProducesResponseTypeMetadata"/> with a <see cref="ProblemDetails"/> type
88
88
/// to <see cref="EndpointBuilder.Metadata"/> for all builders produced by <paramref name="builder"/>.
89
89
/// </summary>
90
- /// <param name="builder">The <see cref="RouteHandlerConventionBuilder "/>.</param>
90
+ /// <param name="builder">The <see cref="RouteHandlerBuilder "/>.</param>
91
91
/// <param name="statusCode">The response status code.</param>
92
92
/// <param name="contentType">The response content type. Defaults to "application/problem+json".</param>
93
- /// <returns>A <see cref="RouteHandlerConventionBuilder "/> that can be used to further customize the endpoint.</returns>
94
- public static RouteHandlerConventionBuilder ProducesProblem ( this RouteHandlerConventionBuilder builder ,
93
+ /// <returns>A <see cref="RouteHandlerBuilder "/> that can be used to further customize the endpoint.</returns>
94
+ public static RouteHandlerBuilder ProducesProblem ( this RouteHandlerBuilder builder ,
95
95
int statusCode ,
96
96
string ? contentType = null )
97
97
{
@@ -107,11 +107,11 @@ public static RouteHandlerConventionBuilder ProducesProblem(this RouteHandlerCon
107
107
/// Adds an <see cref="IProducesResponseTypeMetadata"/> with a <see cref="HttpValidationProblemDetails"/> type
108
108
/// to <see cref="EndpointBuilder.Metadata"/> for all builders produced by <paramref name="builder"/>.
109
109
/// </summary>
110
- /// <param name="builder">The <see cref="RouteHandlerConventionBuilder "/>.</param>
110
+ /// <param name="builder">The <see cref="RouteHandlerBuilder "/>.</param>
111
111
/// <param name="statusCode">The response status code. Defaults to <see cref="StatusCodes.Status400BadRequest"/>.</param>
112
112
/// <param name="contentType">The response content type. Defaults to "application/validationproblem+json".</param>
113
- /// <returns>A <see cref="RouteHandlerConventionBuilder "/> that can be used to further customize the endpoint.</returns>
114
- public static RouteHandlerConventionBuilder ProducesValidationProblem ( this RouteHandlerConventionBuilder builder ,
113
+ /// <returns>A <see cref="RouteHandlerBuilder "/> that can be used to further customize the endpoint.</returns>
114
+ public static RouteHandlerBuilder ProducesValidationProblem ( this RouteHandlerBuilder builder ,
115
115
int statusCode = StatusCodes . Status400BadRequest ,
116
116
string ? contentType = null )
117
117
{
@@ -132,10 +132,10 @@ public static RouteHandlerConventionBuilder ProducesValidationProblem(this Route
132
132
/// into related groups. These tags are typically included in the generated specification
133
133
/// and are typically used to group operations by tags in the UI.
134
134
/// </remarks>
135
- /// <param name="builder">The <see cref="RouteHandlerConventionBuilder "/>.</param>
135
+ /// <param name="builder">The <see cref="RouteHandlerBuilder "/>.</param>
136
136
/// <param name="tags">A collection of tags to be associated with the endpoint.</param>
137
- /// <returns>A <see cref="RouteHandlerConventionBuilder "/> that can be used to further customize the endpoint.</returns>
138
- public static RouteHandlerConventionBuilder WithTags ( this RouteHandlerConventionBuilder builder , params string [ ] tags )
137
+ /// <returns>A <see cref="RouteHandlerBuilder "/> that can be used to further customize the endpoint.</returns>
138
+ public static RouteHandlerBuilder WithTags ( this RouteHandlerBuilder builder , params string [ ] tags )
139
139
{
140
140
builder . WithMetadata ( new TagsAttribute ( tags ) ) ;
141
141
return builder ;
@@ -146,11 +146,11 @@ public static RouteHandlerConventionBuilder WithTags(this RouteHandlerConvention
146
146
/// produced by <paramref name="builder"/>.
147
147
/// </summary>
148
148
/// <typeparam name="TRequest">The type of the request body.</typeparam>
149
- /// <param name="builder">The <see cref="RouteHandlerConventionBuilder "/>.</param>
149
+ /// <param name="builder">The <see cref="RouteHandlerBuilder "/>.</param>
150
150
/// <param name="contentType">The request content type that the endpoint accepts.</param>
151
151
/// <param name="additionalContentTypes">The list of additional request content types that the endpoint accepts.</param>
152
- /// <returns>A <see cref="RouteHandlerConventionBuilder "/> that can be used to further customize the endpoint.</returns>
153
- public static RouteHandlerConventionBuilder Accepts < TRequest > ( this RouteHandlerConventionBuilder builder ,
152
+ /// <returns>A <see cref="RouteHandlerBuilder "/> that can be used to further customize the endpoint.</returns>
153
+ public static RouteHandlerBuilder Accepts < TRequest > ( this RouteHandlerBuilder builder ,
154
154
string contentType , params string [ ] additionalContentTypes ) where TRequest : notnull
155
155
{
156
156
Accepts ( builder , typeof ( TRequest ) , contentType , additionalContentTypes ) ;
@@ -163,12 +163,12 @@ public static RouteHandlerConventionBuilder Accepts<TRequest>(this RouteHandlerC
163
163
/// produced by <paramref name="builder"/>.
164
164
/// </summary>
165
165
/// <typeparam name="TRequest">The type of the request body.</typeparam>
166
- /// <param name="builder">The <see cref="RouteHandlerConventionBuilder "/>.</param>
166
+ /// <param name="builder">The <see cref="RouteHandlerBuilder "/>.</param>
167
167
/// <param name="isOptional">Sets a value that determines if the request body is optional.</param>
168
168
/// <param name="contentType">The request content type that the endpoint accepts.</param>
169
169
/// <param name="additionalContentTypes">The list of additional request content types that the endpoint accepts.</param>
170
- /// <returns>A <see cref="RouteHandlerConventionBuilder "/> that can be used to further customize the endpoint.</returns>
171
- public static RouteHandlerConventionBuilder Accepts < TRequest > ( this RouteHandlerConventionBuilder builder ,
170
+ /// <returns>A <see cref="RouteHandlerBuilder "/> that can be used to further customize the endpoint.</returns>
171
+ public static RouteHandlerBuilder Accepts < TRequest > ( this RouteHandlerBuilder builder ,
172
172
bool isOptional , string contentType , params string [ ] additionalContentTypes ) where TRequest : notnull
173
173
{
174
174
Accepts ( builder , typeof ( TRequest ) , isOptional , contentType , additionalContentTypes ) ;
@@ -180,12 +180,12 @@ public static RouteHandlerConventionBuilder Accepts<TRequest>(this RouteHandlerC
180
180
/// Adds <see cref="IAcceptsMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all builders
181
181
/// produced by <paramref name="builder"/>.
182
182
/// </summary>
183
- /// <param name="builder">The <see cref="RouteHandlerConventionBuilder "/>.</param>
183
+ /// <param name="builder">The <see cref="RouteHandlerBuilder "/>.</param>
184
184
/// <param name="requestType">The type of the request body.</param>
185
185
/// <param name="contentType">The request content type that the endpoint accepts.</param>
186
186
/// <param name="additionalContentTypes">The list of additional request content types that the endpoint accepts.</param>
187
- /// <returns>A <see cref="RouteHandlerConventionBuilder "/> that can be used to further customize the endpoint.</returns>
188
- public static RouteHandlerConventionBuilder Accepts ( this RouteHandlerConventionBuilder builder ,
187
+ /// <returns>A <see cref="RouteHandlerBuilder "/> that can be used to further customize the endpoint.</returns>
188
+ public static RouteHandlerBuilder Accepts ( this RouteHandlerBuilder builder ,
189
189
Type requestType , string contentType , params string [ ] additionalContentTypes )
190
190
{
191
191
builder . WithMetadata ( new AcceptsMetadata ( requestType , false , GetAllContentTypes ( contentType , additionalContentTypes ) ) ) ;
@@ -197,13 +197,13 @@ public static RouteHandlerConventionBuilder Accepts(this RouteHandlerConventionB
197
197
/// Adds <see cref="IAcceptsMetadata"/> to <see cref="EndpointBuilder.Metadata"/> for all builders
198
198
/// produced by <paramref name="builder"/>.
199
199
/// </summary>
200
- /// <param name="builder">The <see cref="RouteHandlerConventionBuilder "/>.</param>
200
+ /// <param name="builder">The <see cref="RouteHandlerBuilder "/>.</param>
201
201
/// <param name="requestType">The type of the request body.</param>
202
202
/// <param name="isOptional">Sets a value that determines if the request body is optional.</param>
203
203
/// <param name="contentType">The request content type that the endpoint accepts.</param>
204
204
/// <param name="additionalContentTypes">The list of additional request content types that the endpoint accepts.</param>
205
- /// <returns>A <see cref="RouteHandlerConventionBuilder "/> that can be used to further customize the endpoint.</returns>
206
- public static RouteHandlerConventionBuilder Accepts ( this RouteHandlerConventionBuilder builder ,
205
+ /// <returns>A <see cref="RouteHandlerBuilder "/> that can be used to further customize the endpoint.</returns>
206
+ public static RouteHandlerBuilder Accepts ( this RouteHandlerBuilder builder ,
207
207
Type requestType , bool isOptional , string contentType , params string [ ] additionalContentTypes )
208
208
{
209
209
builder . WithMetadata ( new AcceptsMetadata ( requestType , isOptional , GetAllContentTypes ( contentType , additionalContentTypes ) ) ) ;
0 commit comments