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