82 instantiations of OpenApiOptions
Microsoft.AspNetCore.OpenApi.Microbenchmarks (2)
GenerationBenchmarks.cs (1)
24
private readonly OpenApiOptions _options = new
OpenApiOptions
();
TransformersBenchmark.cs (1)
25
private readonly OpenApiOptions _options =
new
();
Microsoft.AspNetCore.OpenApi.Tests (80)
Services\CreateSchemaReferenceIdTests.cs (5)
30
var options = new
OpenApiOptions
{ CreateSchemaReferenceId = createReferenceId };
68
var options = new
OpenApiOptions
{ CreateSchemaReferenceId = (type) => type.Type.Name == "Todo" ? $"{type.Type.Name}Schema" : OpenApiOptions.CreateDefaultSchemaReferenceId(type) };
117
var options = new
OpenApiOptions
{ CreateSchemaReferenceId = (type) => type.Type.Name == "Todo" ? null : OpenApiOptions.CreateDefaultSchemaReferenceId(type) };
165
var options = new
OpenApiOptions
208
var options = new
OpenApiOptions
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Info.cs (1)
62
openApiOptions.Setup(o => o.Get(It.IsAny<string>())).Returns(new
OpenApiOptions
());
Services\OpenApiDocumentServiceTestsBase.cs (2)
32
=> await VerifyOpenApiDocument(builder, new
OpenApiOptions
(), verifyOpenApiDocument, cancellationToken);
86
openApiOptions.Setup(o => o.Get(It.IsAny<string>())).Returns(new
OpenApiOptions
());
Transformers\DocumentTransformerTests.cs (10)
20
var options = new
OpenApiOptions
();
47
var options = new
OpenApiOptions
();
64
var options = new
OpenApiOptions
();
81
var options = new
OpenApiOptions
();
107
var options = new
OpenApiOptions
();
133
var options = new
OpenApiOptions
();
152
var options = new
OpenApiOptions
();
171
var options = new
OpenApiOptions
();
199
var options = new
OpenApiOptions
();
226
var options = new
OpenApiOptions
();
Transformers\Implementations\OpenApiSchemaReferenceTransformerTests.cs (2)
276
var options = new
OpenApiOptions
();
461
var options = new
OpenApiOptions
();
Transformers\OpenApiOptionsTests.cs (9)
13
var options = new
OpenApiOptions
();
35
var options = new
OpenApiOptions
();
53
var options = new
OpenApiOptions
();
70
var options = new
OpenApiOptions
();
92
var options = new
OpenApiOptions
();
110
var options = new
OpenApiOptions
();
127
var options = new
OpenApiOptions
();
149
var options = new
OpenApiOptions
();
167
var options = new
OpenApiOptions
();
Transformers\OperationTransformerTests.cs (13)
20
var options = new
OpenApiOptions
();
54
var options = new
OpenApiOptions
();
147
var options = new
OpenApiOptions
();
186
var options = new
OpenApiOptions
();
219
var options = new
OpenApiOptions
();
248
var options = new
OpenApiOptions
();
278
var options = new
OpenApiOptions
();
328
var options = new
OpenApiOptions
();
347
var options = new
OpenApiOptions
();
378
var options = new
OpenApiOptions
();
409
var options = new
OpenApiOptions
();
436
var options = new
OpenApiOptions
();
464
var options = new
OpenApiOptions
();
Transformers\SchemaTransformerTests.cs (25)
21
var options = new
OpenApiOptions
();
76
var options = new
OpenApiOptions
();
113
var options = new
OpenApiOptions
();
134
var options = new
OpenApiOptions
();
152
var options = new
OpenApiOptions
();
181
var options = new
OpenApiOptions
();
211
var options = new
OpenApiOptions
();
241
var options = new
OpenApiOptions
();
264
var options = new
OpenApiOptions
();
288
var options = new
OpenApiOptions
();
326
var options = new
OpenApiOptions
();
363
var options = new
OpenApiOptions
();
389
var options = new
OpenApiOptions
();
415
var options = new
OpenApiOptions
();
448
var options = new
OpenApiOptions
();
483
var options = new
OpenApiOptions
();
518
var options = new
OpenApiOptions
();
553
var options = new
OpenApiOptions
();
594
var options = new
OpenApiOptions
();
635
var options = new
OpenApiOptions
();
676
var options = new
OpenApiOptions
();
711
var options = new
OpenApiOptions
();
766
var options = new
OpenApiOptions
();
793
var options = new
OpenApiOptions
();
820
var options = new
OpenApiOptions
();
Transformers\TypeBasedTransformerLifetimeTests.cs (13)
16
var options = new
OpenApiOptions
();
38
var options = new
OpenApiOptions
();
64
var options = new
OpenApiOptions
();
90
var options = new
OpenApiOptions
();
115
var options = new
OpenApiOptions
();
137
var options = new
OpenApiOptions
();
162
var options = new
OpenApiOptions
();
188
var options = new
OpenApiOptions
();
213
var options = new
OpenApiOptions
();
234
var options = new
OpenApiOptions
();
257
var options = new
OpenApiOptions
();
283
var options = new
OpenApiOptions
();
309
var options = new
OpenApiOptions
();
164 references to OpenApiOptions
Microsoft.AspNetCore.OpenApi (41)
Extensions\OpenApiEndpointRouteBuilderExtensions.cs (2)
30
var options = endpoints.ServiceProvider.GetRequiredService<IOptionsMonitor<
OpenApiOptions
>>();
47
var
documentOptions = options.Get(documentName);
Extensions\OpenApiServiceCollectionExtensions.cs (5)
43
/// <param name="configureOptions">A delegate used to configure the target <see cref="
OpenApiOptions
"/>.</param>
55
public static IServiceCollection AddOpenApi(this IServiceCollection services, string documentName, Action<
OpenApiOptions
> configureOptions)
61
services.Configure<
OpenApiOptions
>(documentName, options =>
73
/// <param name="configureOptions">A delegate used to configure the target <see cref="
OpenApiOptions
"/>.</param>
85
public static IServiceCollection AddOpenApi(this IServiceCollection services, Action<
OpenApiOptions
> configureOptions)
Services\OpenApiDocumentProvider.cs (2)
28
var options = serviceProvider.GetRequiredService<IOptionsMonitor<
OpenApiOptions
>>();
29
var
namedOption = options.Get(documentName);
Services\OpenApiDocumentService.cs (2)
36
IOptionsMonitor<
OpenApiOptions
> optionsMonitor,
40
private readonly
OpenApiOptions
_options = optionsMonitor.Get(documentName);
Services\OpenApiOptions.cs (29)
29
/// Initializes a new instance of the <see cref="
OpenApiOptions
"/> class
43
/// The name of the OpenAPI document this <see cref="
OpenApiOptions
"/> instance is associated with.
62
/// Registers a new document transformer on the current <see cref="
OpenApiOptions
"/> instance.
65
/// <returns>The <see cref="
OpenApiOptions
"/> instance for further customization.</returns>
66
public
OpenApiOptions
AddDocumentTransformer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TTransformerType>()
74
/// Registers a given instance of <see cref="IOpenApiDocumentTransformer"/> on the current <see cref="
OpenApiOptions
"/> instance.
77
/// <returns>The <see cref="
OpenApiOptions
"/> instance for further customization.</returns>
78
public
OpenApiOptions
AddDocumentTransformer(IOpenApiDocumentTransformer transformer)
87
/// Registers a given delegate as a document transformer on the current <see cref="
OpenApiOptions
"/> instance.
90
/// <returns>The <see cref="
OpenApiOptions
"/> instance for further customization.</returns>
91
public
OpenApiOptions
AddDocumentTransformer(Func<OpenApiDocument, OpenApiDocumentTransformerContext, CancellationToken, Task> transformer)
100
/// Registers a new operation transformer on the current <see cref="
OpenApiOptions
"/> instance.
103
/// <returns>The <see cref="
OpenApiOptions
"/> instance for further customization.</returns>
104
public
OpenApiOptions
AddOperationTransformer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TTransformerType>()
112
/// Registers a given instance of <see cref="IOpenApiOperationTransformer"/> on the current <see cref="
OpenApiOptions
"/> instance.
115
/// <returns>The <see cref="
OpenApiOptions
"/> instance for further customization.</returns>
116
public
OpenApiOptions
AddOperationTransformer(IOpenApiOperationTransformer transformer)
125
/// Registers a given delegate as an operation transformer on the current <see cref="
OpenApiOptions
"/> instance.
128
/// <returns>The <see cref="
OpenApiOptions
"/> instance for further customization.</returns>
129
public
OpenApiOptions
AddOperationTransformer(Func<OpenApiOperation, OpenApiOperationTransformerContext, CancellationToken, Task> transformer)
138
/// Registers a new schema transformer on the current <see cref="
OpenApiOptions
"/> instance.
141
/// <returns>The <see cref="
OpenApiOptions
"/> instance for further customization.</returns>
142
public
OpenApiOptions
AddSchemaTransformer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TTransformerType>()
150
/// Registers a given instance of <see cref="IOpenApiOperationTransformer"/> on the current <see cref="
OpenApiOptions
"/> instance.
153
/// <returns>The <see cref="
OpenApiOptions
"/> instance for further customization.</returns>
154
public
OpenApiOptions
AddSchemaTransformer(IOpenApiSchemaTransformer transformer)
163
/// Registers a given delegate as a schema transformer on the current <see cref="
OpenApiOptions
"/> instance.
166
/// <returns>The <see cref="
OpenApiOptions
"/> instance for further customization.</returns>
167
public
OpenApiOptions
AddSchemaTransformer(Func<OpenApiSchema, OpenApiSchemaTransformerContext, CancellationToken, Task> transformer)
Services\Schemas\OpenApiSchemaService.cs (1)
32
IOptionsMonitor<
OpenApiOptions
> optionsMonitor)
Microsoft.AspNetCore.OpenApi.Microbenchmarks (2)
GenerationBenchmarks.cs (1)
24
private readonly
OpenApiOptions
_options = new OpenApiOptions();
TransformersBenchmark.cs (1)
25
private readonly
OpenApiOptions
_options = new();
Microsoft.AspNetCore.OpenApi.Tests (119)
Extensions\OpenApiServiceCollectionExtensionsTests.cs (12)
41
var options = serviceProvider.GetRequiredService<IOptionsSnapshot<
OpenApiOptions
>>();
42
var
namedOption = options.Get(documentName);
75
var options = serviceProvider.GetRequiredService<IOptionsSnapshot<
OpenApiOptions
>>();
76
var
namedOption = options.Get(documentName);
108
var options = serviceProvider.GetRequiredService<IOptionsSnapshot<
OpenApiOptions
>>();
109
var
namedOption = options.Get(documentName);
141
var options = serviceProvider.GetRequiredService<IOptionsSnapshot<
OpenApiOptions
>>();
142
var
namedOption = options.Get(documentName);
163
var options = serviceProvider.GetRequiredService<IOptionsSnapshot<
OpenApiOptions
>>();
164
var
namedOption = options.Get(documentName);
187
var options = serviceProvider.GetRequiredService<IOptionsSnapshot<
OpenApiOptions
>>();
188
var
namedOption = options.Get(documentName);
Services\CreateSchemaReferenceIdTests.cs (9)
30
var
options = new OpenApiOptions { CreateSchemaReferenceId = createReferenceId };
68
var
options = new OpenApiOptions { CreateSchemaReferenceId = (type) => type.Type.Name == "Todo" ? $"{type.Type.Name}Schema" :
OpenApiOptions
.CreateDefaultSchemaReferenceId(type) };
117
var
options = new OpenApiOptions { CreateSchemaReferenceId = (type) => type.Type.Name == "Todo" ? null :
OpenApiOptions
.CreateDefaultSchemaReferenceId(type) };
165
var
options = new OpenApiOptions
173
return
OpenApiOptions
.CreateDefaultSchemaReferenceId(type);
208
var
options = new OpenApiOptions
216
return
OpenApiOptions
.CreateDefaultSchemaReferenceId(type);
Services\OpenApiDocumentService\OpenApiDocumentServiceTests.Info.cs (2)
59
internal IOptionsMonitor<
OpenApiOptions
> GetMockOptionsMonitor()
61
var openApiOptions = new Mock<IOptionsMonitor<
OpenApiOptions
>>();
Services\OpenApiDocumentServiceTestsBase.cs (5)
34
public static async Task VerifyOpenApiDocument(IEndpointRouteBuilder builder,
OpenApiOptions
openApiOptions, Action<OpenApiDocument> verifyOpenApiDocument, CancellationToken cancellationToken = default)
85
var openApiOptions = new Mock<IOptionsMonitor<
OpenApiOptions
>>();
112
internal static OpenApiDocumentService CreateDocumentService(IEndpointRouteBuilder builder,
OpenApiOptions
openApiOptions)
121
var options = new Mock<IOptionsMonitor<
OpenApiOptions
>>();
265
serviceCollection.Configure<
OpenApiOptions
>("Test", options =>
Transformers\DocumentTransformerTests.cs (10)
20
var
options = new OpenApiOptions();
47
var
options = new OpenApiOptions();
64
var
options = new OpenApiOptions();
81
var
options = new OpenApiOptions();
107
var
options = new OpenApiOptions();
133
var
options = new OpenApiOptions();
152
var
options = new OpenApiOptions();
171
var
options = new OpenApiOptions();
199
var
options = new OpenApiOptions();
226
var
options = new OpenApiOptions();
Transformers\Implementations\OpenApiSchemaReferenceTransformerTests.cs (2)
276
var
options = new OpenApiOptions();
461
var
options = new OpenApiOptions();
Transformers\OpenApiOptionsTests.cs (27)
13
var
options = new OpenApiOptions();
21
var
result = options.AddDocumentTransformer(transformer);
26
Assert.IsType<
OpenApiOptions
>(result);
35
var
options = new OpenApiOptions();
39
var
result = options.AddDocumentTransformer(transformer);
44
Assert.IsType<
OpenApiOptions
>(result);
53
var
options = new OpenApiOptions();
56
var
result = options.AddDocumentTransformer<TestOpenApiDocumentTransformer>();
61
Assert.IsType<
OpenApiOptions
>(result);
70
var
options = new OpenApiOptions();
78
var
result = options.AddOperationTransformer(transformer);
83
Assert.IsType<
OpenApiOptions
>(result);
92
var
options = new OpenApiOptions();
96
var
result = options.AddOperationTransformer(transformer);
101
Assert.IsType<
OpenApiOptions
>(result);
110
var
options = new OpenApiOptions();
113
var
result = options.AddOperationTransformer<TestOpenApiOperationTransformer>();
118
Assert.IsType<
OpenApiOptions
>(result);
127
var
options = new OpenApiOptions();
135
var
result = options.AddSchemaTransformer(transformer);
140
Assert.IsType<
OpenApiOptions
>(result);
149
var
options = new OpenApiOptions();
153
var
result = options.AddSchemaTransformer(transformer);
158
Assert.IsType<
OpenApiOptions
>(result);
167
var
options = new OpenApiOptions();
170
var
result = options.AddSchemaTransformer<TestOpenApiSchemaTransformer>();
175
Assert.IsType<
OpenApiOptions
>(result);
Transformers\OperationTransformerTests.cs (13)
20
var
options = new OpenApiOptions();
54
var
options = new OpenApiOptions();
147
var
options = new OpenApiOptions();
186
var
options = new OpenApiOptions();
219
var
options = new OpenApiOptions();
248
var
options = new OpenApiOptions();
278
var
options = new OpenApiOptions();
328
var
options = new OpenApiOptions();
347
var
options = new OpenApiOptions();
378
var
options = new OpenApiOptions();
409
var
options = new OpenApiOptions();
436
var
options = new OpenApiOptions();
464
var
options = new OpenApiOptions();
Transformers\SchemaTransformerTests.cs (26)
21
var
options = new OpenApiOptions();
76
var
options = new OpenApiOptions();
113
var
options = new OpenApiOptions();
134
var
options = new OpenApiOptions();
152
var
options = new OpenApiOptions();
181
var
options = new OpenApiOptions();
211
var
options = new OpenApiOptions();
241
var
options = new OpenApiOptions();
264
var
options = new OpenApiOptions();
288
var
options = new OpenApiOptions();
326
var
options = new OpenApiOptions();
363
var
options = new OpenApiOptions();
389
var
options = new OpenApiOptions();
415
var
options = new OpenApiOptions();
448
var
options = new OpenApiOptions();
483
var
options = new OpenApiOptions();
518
var
options = new OpenApiOptions();
553
var
options = new OpenApiOptions();
594
var
options = new OpenApiOptions();
635
var
options = new OpenApiOptions();
676
var
options = new OpenApiOptions();
711
var
options = new OpenApiOptions();
745
static void UseNotSchemaTransformer(
OpenApiOptions
options, Func<OpenApiSchema, OpenApiSchemaTransformerContext, CancellationToken, Task> func)
766
var
options = new OpenApiOptions();
793
var
options = new OpenApiOptions();
820
var
options = new OpenApiOptions();
Transformers\TypeBasedTransformerLifetimeTests.cs (13)
16
var
options = new OpenApiOptions();
38
var
options = new OpenApiOptions();
64
var
options = new OpenApiOptions();
90
var
options = new OpenApiOptions();
115
var
options = new OpenApiOptions();
137
var
options = new OpenApiOptions();
162
var
options = new OpenApiOptions();
188
var
options = new OpenApiOptions();
213
var
options = new OpenApiOptions();
234
var
options = new OpenApiOptions();
257
var
options = new OpenApiOptions();
283
var
options = new OpenApiOptions();
309
var
options = new OpenApiOptions();
Sample (2)
Transformers\OperationTransformers.cs (2)
13
public static
OpenApiOptions
AddHeader(this
OpenApiOptions
options, string headerName, string defaultValue)