diff --git a/Aspire.sln b/Aspire.sln index 89348fb9b9a..f143f474703 100644 --- a/Aspire.sln +++ b/Aspire.sln @@ -165,9 +165,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{2136E31D EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConfigurationSchemaGenerator", "src\Tools\ConfigurationSchemaGenerator\ConfigurationSchemaGenerator.csproj", "{39FA2A64-012F-4EB9-A14F-E8AC54C975F6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.MongoDB.Driver", "src\Components\Aspire.MongoDB.Driver\Aspire.MongoDB.Driver.csproj", "{20A5A907-A135-4735-B4BF-E13514F360E3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.MongoDB.Driver", "src\Components\Aspire.MongoDB.Driver\Aspire.MongoDB.Driver.csproj", "{20A5A907-A135-4735-B4BF-E13514F360E3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.MongoDB.Driver.Tests", "tests\Aspire.MongoDB.Driver.Tests\Aspire.MongoDB.Driver.Tests.csproj", "{E592E447-BA3C-44FA-86C1-EBEDC864A644}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.MongoDB.Driver.Tests", "tests\Aspire.MongoDB.Driver.Tests\Aspire.MongoDB.Driver.Tests.csproj", "{E592E447-BA3C-44FA-86C1-EBEDC864A644}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConfigurationSchemaGenerator.Tests", "tests\ConfigurationSchemaGenerator.Tests\ConfigurationSchemaGenerator.Tests.csproj", "{00FEA181-84C9-42A7-AC81-29A9F176A1A0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -439,6 +441,10 @@ Global {DCF2D47A-921A-4900-B5B2-CF97B3531CE8}.Debug|Any CPU.Build.0 = Debug|Any CPU {DCF2D47A-921A-4900-B5B2-CF97B3531CE8}.Release|Any CPU.ActiveCfg = Release|Any CPU {DCF2D47A-921A-4900-B5B2-CF97B3531CE8}.Release|Any CPU.Build.0 = Release|Any CPU + {39FA2A64-012F-4EB9-A14F-E8AC54C975F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39FA2A64-012F-4EB9-A14F-E8AC54C975F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39FA2A64-012F-4EB9-A14F-E8AC54C975F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39FA2A64-012F-4EB9-A14F-E8AC54C975F6}.Release|Any CPU.Build.0 = Release|Any CPU {20A5A907-A135-4735-B4BF-E13514F360E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {20A5A907-A135-4735-B4BF-E13514F360E3}.Debug|Any CPU.Build.0 = Debug|Any CPU {20A5A907-A135-4735-B4BF-E13514F360E3}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -447,14 +453,10 @@ Global {E592E447-BA3C-44FA-86C1-EBEDC864A644}.Debug|Any CPU.Build.0 = Debug|Any CPU {E592E447-BA3C-44FA-86C1-EBEDC864A644}.Release|Any CPU.ActiveCfg = Release|Any CPU {E592E447-BA3C-44FA-86C1-EBEDC864A644}.Release|Any CPU.Build.0 = Release|Any CPU - {6472D59F-7C04-43DE-AD33-9F20BE3804BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6472D59F-7C04-43DE-AD33-9F20BE3804BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6472D59F-7C04-43DE-AD33-9F20BE3804BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6472D59F-7C04-43DE-AD33-9F20BE3804BF}.Release|Any CPU.Build.0 = Release|Any CPU - {39FA2A64-012F-4EB9-A14F-E8AC54C975F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {39FA2A64-012F-4EB9-A14F-E8AC54C975F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {39FA2A64-012F-4EB9-A14F-E8AC54C975F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {39FA2A64-012F-4EB9-A14F-E8AC54C975F6}.Release|Any CPU.Build.0 = Release|Any CPU + {00FEA181-84C9-42A7-AC81-29A9F176A1A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {00FEA181-84C9-42A7-AC81-29A9F176A1A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {00FEA181-84C9-42A7-AC81-29A9F176A1A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {00FEA181-84C9-42A7-AC81-29A9F176A1A0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -529,10 +531,11 @@ Global {6472D59F-7C04-43DE-AD33-9F20BE3804BF} = {975F6F41-B455-451D-A312-098DE4A167B6} {CA283D7F-EB95-4353-B196-C409965D2B42} = {27381127-6C45-4B4C-8F18-41FF48DFE4B2} {C8079F06-304F-49B1-A0C1-45AA3782A923} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60} - {20A5A907-A135-4735-B4BF-E13514F360E3} = {27381127-6C45-4B4C-8F18-41FF48DFE4B2} - {E592E447-BA3C-44FA-86C1-EBEDC864A644} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60} {DCF2D47A-921A-4900-B5B2-CF97B3531CE8} = {975F6F41-B455-451D-A312-098DE4A167B6} {39FA2A64-012F-4EB9-A14F-E8AC54C975F6} = {2136E31D-2CBB-41BB-8618-716FF8E46E9E} + {20A5A907-A135-4735-B4BF-E13514F360E3} = {27381127-6C45-4B4C-8F18-41FF48DFE4B2} + {E592E447-BA3C-44FA-86C1-EBEDC864A644} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60} + {00FEA181-84C9-42A7-AC81-29A9F176A1A0} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6DCEDFEC-988E-4CB3-B45B-191EB5086E0C} diff --git a/src/Components/Aspire.Azure.Data.Tables/Aspire.Azure.Data.Tables.csproj b/src/Components/Aspire.Azure.Data.Tables/Aspire.Azure.Data.Tables.csproj index 620fa1658c4..470ad9d7353 100644 --- a/src/Components/Aspire.Azure.Data.Tables/Aspire.Azure.Data.Tables.csproj +++ b/src/Components/Aspire.Azure.Data.Tables/Aspire.Azure.Data.Tables.csproj @@ -13,6 +13,7 @@ + diff --git a/src/Components/Aspire.Azure.Data.Tables/AssemblyInfo.cs b/src/Components/Aspire.Azure.Data.Tables/AssemblyInfo.cs new file mode 100644 index 00000000000..3cb76e2da4a --- /dev/null +++ b/src/Components/Aspire.Azure.Data.Tables/AssemblyInfo.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.Azure.Data.Tables; +using Azure.Data.Tables; + +[assembly: ConfigurationSchema("Aspire:Azure:Data:Tables", typeof(AzureDataTablesSettings))] +[assembly: ConfigurationSchema("Aspire:Azure:Data:Tables:ClientOptions", typeof(TableClientOptions), exclusionPaths: ["Default"])] + +[assembly: LoggingCategories( + "Azure", + "Azure.Core", + "Azure.Identity")] diff --git a/src/Components/Aspire.Azure.Data.Tables/ConfigurationSchema.json b/src/Components/Aspire.Azure.Data.Tables/ConfigurationSchema.json index c11b7890a1d..dc5c8ccf367 100644 --- a/src/Components/Aspire.Azure.Data.Tables/ConfigurationSchema.json +++ b/src/Components/Aspire.Azure.Data.Tables/ConfigurationSchema.json @@ -27,49 +27,69 @@ "Tables": { "type": "object", "properties": { - "ServiceUri": { - "type": "string", - "format": "uri", - "description": "Gets or sets the 'Uri' referencing the table service account. This is likely to be similar to \"https://{account_name}.table.core.windows.net/\" or \"https://{account_name}.table.cosmos.azure.com/\"." - }, - "HealthChecks": { - "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the health check is enabled or not.", - "default": true - }, - "Tracing": { - "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", - "default": false - }, "ClientOptions": { "type": "object", - "description": "Options to configure the requests to the Table service.", "properties": { + "Diagnostics": { + "type": "object", + "properties": { + "ApplicationId": { + "type": "string", + "description": "Gets or sets the value sent as the first part of \"User-Agent\" headers for all requests issues by this client. Defaults to P:Azure.Core.DiagnosticsOptions.DefaultApplicationId." + }, + "DefaultApplicationId": { + "type": "string", + "description": "Gets or sets the default application id. Default application id would be set on all instances." + }, + "IsDistributedTracingEnabled": { + "type": "boolean", + "description": "Gets or sets value indicating whether distributed tracing activities ( T:System.Diagnostics.Activity ) are going to be created for the clients methods calls and HTTP calls." + }, + "IsLoggingContentEnabled": { + "type": "boolean", + "description": "Gets or sets value indicating if request or response content should be logged." + }, + "IsLoggingEnabled": { + "type": "boolean", + "description": "Get or sets value indicating whether HTTP pipeline logging is enabled." + }, + "IsTelemetryEnabled": { + "type": "boolean", + "description": "Gets or sets value indicating whether the \"User-Agent\" header containing P:Azure.Core.DiagnosticsOptions.ApplicationId , client library package name and version, P:System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription and P:System.Runtime.InteropServices.RuntimeInformation.OSDescription should be sent.\nThe default value can be controlled process wide by setting AZURE_TELEMETRY_DISABLED to true , false , 1 or 0." + }, + "LoggedContentSizeLimit": { + "type": "integer", + "description": "Gets or sets value indicating maximum size of content to log in bytes. Defaults to 4096." + } + }, + "description": "Gets the client diagnostic options." + }, "EnableTenantDiscovery": { "type": "boolean", - "description": "Enables tenant discovery through the authorization challenge when the client is configured to use a TokenCredential. When true, the client will attempt an initial un-authorized request to prompt an OAuth challenge in order to discover the correct tenant for the resource." + "description": "Enables tenant discovery through the authorization challenge when the client is configured to use a TokenCredential.\nWhen true , the client will attempt an initial un-authorized request to prompt an OAuth challenge in order to discover the correct tenant for the resource." }, "Retry": { "type": "object", - "description": "The set of options that can be specified to influence how retry attempts are made, and a failure is eligible to be retried", "properties": { "Delay": { "type": "string", "format": "duration", - "description": "The delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-based approach. If the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." + "description": "The delay between retry attempts for a fixed approach or the delay\non which to base calculations for a backoff-based approach.\nIf the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." }, "MaxDelay": { "type": "string", "format": "duration", - "description": "The maximum permissible delay between retry attempts when the service does not provide a Retry-After response header. If the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." + "description": "The maximum permissible delay between retry attempts when the service does not provide a Retry-After response header.\nIf the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." }, "MaxRetries": { "type": "integer", "description": "The maximum number of retry attempts before giving up." }, "Mode": { - "enum": [ "Fixed", "Exponential" ], + "enum": [ + "Fixed", + "Exponential" + ], "description": "The approach to use for calculating retry delays." }, "NetworkTimeout": { @@ -77,11 +97,33 @@ "format": "duration", "description": "The timeout applied to an individual network operations." } - } + }, + "description": "Gets the client retry options." } - } + }, + "description": "Options to configure the requests to the Table service." + }, + "ConnectionString": { + "type": "string", + "description": "Gets or sets the connection string used to connect to the table service account." + }, + "HealthChecks": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the health check is enabled or not.", + "default": true + }, + "ServiceUri": { + "type": "string", + "format": "uri", + "description": "A T:System.Uri referencing the table service account.\nThis is likely to be similar to \"https://{account_name}.table.core.windows.net/\" or \"https://{account_name}.table.cosmos.azure.com/\"." + }, + "Tracing": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", + "default": true } - } + }, + "description": "Provides the client configuration settings for connecting to Azure Tables." } } } diff --git a/src/Components/Aspire.Azure.Messaging.ServiceBus/Aspire.Azure.Messaging.ServiceBus.csproj b/src/Components/Aspire.Azure.Messaging.ServiceBus/Aspire.Azure.Messaging.ServiceBus.csproj index b3a5e175b39..40ee0d2411d 100644 --- a/src/Components/Aspire.Azure.Messaging.ServiceBus/Aspire.Azure.Messaging.ServiceBus.csproj +++ b/src/Components/Aspire.Azure.Messaging.ServiceBus/Aspire.Azure.Messaging.ServiceBus.csproj @@ -13,6 +13,7 @@ + diff --git a/src/Components/Aspire.Azure.Messaging.ServiceBus/AssemblyInfo.cs b/src/Components/Aspire.Azure.Messaging.ServiceBus/AssemblyInfo.cs new file mode 100644 index 00000000000..7e29e408f84 --- /dev/null +++ b/src/Components/Aspire.Azure.Messaging.ServiceBus/AssemblyInfo.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.Azure.Messaging.ServiceBus; +using Azure.Messaging.ServiceBus; + +[assembly: ConfigurationSchema("Aspire:Azure:Messaging:ServiceBus", typeof(AzureMessagingServiceBusSettings))] +[assembly: ConfigurationSchema("Aspire:Azure:Messaging:ServiceBus:ClientOptions", typeof(ServiceBusClientOptions))] + +[assembly: LoggingCategories( + "Azure", + "Azure.Core", + "Azure.Identity", + "Azure.Messaging.ServiceBus")] diff --git a/src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json b/src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json index 0be7934565a..4d6f91c5793 100644 --- a/src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json +++ b/src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json @@ -30,56 +30,34 @@ "ServiceBus": { "type": "object", "properties": { - "Namespace": { - "type": "string", - "description": "Gets or sets the fully qualified Service Bus namespace. Used along with \"Credential\" to establish the connection." - }, - "ConnectionString": { - "type": "string", - "description": "Gets or sets connection string used to connect to the Service Bus namespace." - }, - "HealthCheckQueueName": { - "type": "string", - "description": "Name of the queue used by the health check. Mandatory to get health checks enabled." - }, - "HealthCheckTopicName": { - "type": "string", - "description": "Name of the topic used by the health check. Mandatory to get health checks enabled" - }, - "Tracing": { - "type": "boolean", - "description": "A boolean value that indicates whether the OpenTelemetry tracing is enabled or not" - }, "ClientOptions": { "type": "object", - "description": "The set of options that can be specified when creating an Azure.Messaging.ServiceBus.ServiceBusConnection to configure its behavior.", "properties": { "ConnectionIdleTimeout": { "type": "string", "format": "duration", - "description": "The amount of time to allow a connection to have no observed traffic before considering it idle and eligible to close." + "description": "The amount of time to allow a connection to have no observed traffic before considering\nit idle and eligible to close." }, "CustomEndpointAddress": { "type": "string", "format": "uri", - "description": "A custom endpoint address that can be used when establishing the connection to the Service Bus service." + "description": "A custom endpoint address that can be used when establishing the connection to the Service Bus\nservice." }, "EnableCrossEntityTransactions": { "type": "boolean", - "Description": "Gets or sets a flag that indicates whether or not transactions may span multiple Service Bus entities." + "description": "Gets or sets a flag that indicates whether or not transactions may span multiple\nService Bus entities." }, "Identifier": { "type": "string", - "Description": "A property used to set the ServiceBusClient ID to identify the client. This can be used to correlate logs and exceptions. If null or empty, a random unique value will be used." + "description": "A property used to set the T:Azure.Messaging.ServiceBus.ServiceBusClient ID to identify the client. This can be used to correlate logs\nand exceptions. If null or empty, a random unique value will be used." }, "RetryOptions": { "type": "object", - "description": "The set of options to use for determining whether a failed service operation should be retried and, if so, the amount of time to wait between retry attempts. These options also control the amount of time allowed for the individual network operations used for interactions with the Service Bus service.", "properties": { "Delay": { "type": "string", "format": "duration", - "description": "The delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-based approach." + "description": "The delay between retry attempts for a fixed approach or the delay\non which to base calculations for a backoff-based approach." }, "MaxDelay": { "type": "string", @@ -88,26 +66,55 @@ }, "MaxRetries": { "type": "integer", - "description": "The maximum number of retry attempts before considering the associated operation to have failed." + "description": "The maximum number of retry attempts before considering the associated operation\nto have failed." }, "Mode": { - "enum": [ "Fixed", "Exponential" ], + "enum": [ + "Fixed", + "Exponential" + ], "description": "The approach to use for calculating retry delays." }, "TryTimeout": { "type": "string", "format": "duration", - "description": "The maximum duration to wait for completion of a single attempt, whether the initial attempt or a retry." + "description": "The maximum duration to wait for completion of a single attempt, whether the initial\nattempt or a retry." } - } + }, + "description": "The set of options to use for determining whether a failed service operation should be retried and,\nif so, the amount of time to wait between retry attempts. These options also control the\namount of time allowed for the individual network operations used for interactions with the Service Bus service." }, "TransportType": { - "enum": [ "AmqpTcp", "AmqpWebSockets" ], - "Description": "The type of protocol and transport that will be used for communicating with the Service Bus service." + "enum": [ + "AmqpTcp", + "AmqpWebSockets" + ], + "description": "The type of protocol and transport that will be used for communicating with the Service Bus\nservice." } - } + }, + "description": "The set of options that can be specified when creating an T:Azure.Messaging.ServiceBus.ServiceBusConnection to configure its behavior." + }, + "ConnectionString": { + "type": "string", + "description": "Gets or sets the connection string used to connect to the Service Bus namespace." + }, + "HealthCheckQueueName": { + "type": "string", + "description": "Name of the queue used by the health check. Mandatory to get health checks enabled." + }, + "HealthCheckTopicName": { + "type": "string", + "description": "Name of the topic used by the health check. Mandatory to get health checks enabled." + }, + "Namespace": { + "type": "string", + "description": "Gets or sets the fully qualified Service Bus namespace." + }, + "Tracing": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not." } - } + }, + "description": "Provides the client configuration settings for connecting to Azure Service Bus." } } } diff --git a/src/Components/Aspire.Azure.Security.KeyVault/Aspire.Azure.Security.KeyVault.csproj b/src/Components/Aspire.Azure.Security.KeyVault/Aspire.Azure.Security.KeyVault.csproj index a5e4d0236d3..6407a1e9ad3 100644 --- a/src/Components/Aspire.Azure.Security.KeyVault/Aspire.Azure.Security.KeyVault.csproj +++ b/src/Components/Aspire.Azure.Security.KeyVault/Aspire.Azure.Security.KeyVault.csproj @@ -13,6 +13,7 @@ + diff --git a/src/Components/Aspire.Azure.Security.KeyVault/AssemblyInfo.cs b/src/Components/Aspire.Azure.Security.KeyVault/AssemblyInfo.cs new file mode 100644 index 00000000000..70fbbc568b4 --- /dev/null +++ b/src/Components/Aspire.Azure.Security.KeyVault/AssemblyInfo.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.Azure.Security.KeyVault; +using Azure.Security.KeyVault.Secrets; + +[assembly: ConfigurationSchema("Aspire:Azure:Security:KeyVault", typeof(AzureSecurityKeyVaultSettings))] +[assembly: ConfigurationSchema("Aspire:Azure:Security:KeyVault:ClientOptions", typeof(SecretClientOptions), exclusionPaths: ["Default"])] + +[assembly: LoggingCategories( + "Azure", + "Azure.Core", + "Azure.Identity")] diff --git a/src/Components/Aspire.Azure.Security.KeyVault/ConfigurationSchema.json b/src/Components/Aspire.Azure.Security.KeyVault/ConfigurationSchema.json index 7972bba2eeb..17e335b5a9e 100644 --- a/src/Components/Aspire.Azure.Security.KeyVault/ConfigurationSchema.json +++ b/src/Components/Aspire.Azure.Security.KeyVault/ConfigurationSchema.json @@ -27,49 +27,69 @@ "KeyVault": { "type": "object", "properties": { - "VaultUri": { - "type": "string", - "format": "uri", - "description": "Gets or sets the 'Uri' to the vault on which the client operates. Appears as 'DNS Name' in the Azure portal. If you have a secret 'Uri', use 'KeyVaultSecretIdentifier' to parse the 'KeyVaultSecretIdentifier.VaultUri' and other information. You should validate that this URI references a valid Key Vault resource." - }, - "HealthChecks": { - "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the Key Vaulte health check is enabled or not.", - "default": true - }, - "Tracing": { - "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", - "default": false - }, "ClientOptions": { "type": "object", - "description": "Options that allow you to configure the requests sent to Key Vault.", "properties": { + "Diagnostics": { + "type": "object", + "properties": { + "ApplicationId": { + "type": "string", + "description": "Gets or sets the value sent as the first part of \"User-Agent\" headers for all requests issues by this client. Defaults to P:Azure.Core.DiagnosticsOptions.DefaultApplicationId." + }, + "DefaultApplicationId": { + "type": "string", + "description": "Gets or sets the default application id. Default application id would be set on all instances." + }, + "IsDistributedTracingEnabled": { + "type": "boolean", + "description": "Gets or sets value indicating whether distributed tracing activities ( T:System.Diagnostics.Activity ) are going to be created for the clients methods calls and HTTP calls." + }, + "IsLoggingContentEnabled": { + "type": "boolean", + "description": "Gets or sets value indicating if request or response content should be logged." + }, + "IsLoggingEnabled": { + "type": "boolean", + "description": "Get or sets value indicating whether HTTP pipeline logging is enabled." + }, + "IsTelemetryEnabled": { + "type": "boolean", + "description": "Gets or sets value indicating whether the \"User-Agent\" header containing P:Azure.Core.DiagnosticsOptions.ApplicationId , client library package name and version, P:System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription and P:System.Runtime.InteropServices.RuntimeInformation.OSDescription should be sent.\nThe default value can be controlled process wide by setting AZURE_TELEMETRY_DISABLED to true , false , 1 or 0." + }, + "LoggedContentSizeLimit": { + "type": "integer", + "description": "Gets or sets value indicating maximum size of content to log in bytes. Defaults to 4096." + } + }, + "description": "Gets the client diagnostic options." + }, "DisableChallengeResourceVerification": { "type": "boolean", "description": "Gets or sets whether to disable verification that the authentication challenge resource matches the Key Vault domain." }, "Retry": { "type": "object", - "description": "The set of options that can be specified to influence how retry attempts are made, and a failure is eligible to be retried", "properties": { "Delay": { "type": "string", "format": "duration", - "description": "The delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-based approach. If the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." + "description": "The delay between retry attempts for a fixed approach or the delay\non which to base calculations for a backoff-based approach.\nIf the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." }, "MaxDelay": { "type": "string", "format": "duration", - "description": "The maximum permissible delay between retry attempts when the service does not provide a Retry-After response header. If the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." + "description": "The maximum permissible delay between retry attempts when the service does not provide a Retry-After response header.\nIf the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." }, "MaxRetries": { "type": "integer", "description": "The maximum number of retry attempts before giving up." }, "Mode": { - "enum": [ "Fixed", "Exponential" ], + "enum": [ + "Fixed", + "Exponential" + ], "description": "The approach to use for calculating retry delays." }, "NetworkTimeout": { @@ -77,11 +97,29 @@ "format": "duration", "description": "The timeout applied to an individual network operations." } - } + }, + "description": "Gets the client retry options." } - } + }, + "description": "Options that allow you to configure the requests sent to Key Vault." + }, + "HealthChecks": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the Key Vault health check is enabled or not.", + "default": true + }, + "Tracing": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", + "default": true + }, + "VaultUri": { + "type": "string", + "format": "uri", + "description": "A T:System.Uri to the vault on which the client operates. Appears as \"DNS Name\" in the Azure portal.\nIf you have a secret T:System.Uri , use T:Azure.Security.KeyVault.Secrets.KeyVaultSecretIdentifier to parse the P:Azure.Security.KeyVault.Secrets.KeyVaultSecretIdentifier.VaultUri and other information.\nYou should validate that this URI references a valid Key Vault resource. See https://aka.ms/azsdk/blog/vault-uri for details." } - } + }, + "description": "Provides the client configuration settings for connecting to Azure Key Vault." } } } diff --git a/src/Components/Aspire.Azure.Storage.Blobs/AssemblyInfo.cs b/src/Components/Aspire.Azure.Storage.Blobs/AssemblyInfo.cs index 51aad8d9a59..524efad0cfe 100644 --- a/src/Components/Aspire.Azure.Storage.Blobs/AssemblyInfo.cs +++ b/src/Components/Aspire.Azure.Storage.Blobs/AssemblyInfo.cs @@ -8,4 +8,7 @@ [assembly: ConfigurationSchema("Aspire:Azure:Storage:Blobs", typeof(AzureStorageBlobsSettings))] [assembly: ConfigurationSchema("Aspire:Azure:Storage:Blobs:ClientOptions", typeof(BlobClientOptions), exclusionPaths: ["Default"])] -[assembly: LoggingCategories("Azure", "Azure.Core", "Azure.Identity")] +[assembly: LoggingCategories( + "Azure", + "Azure.Core", + "Azure.Identity")] diff --git a/src/Components/Aspire.Azure.Storage.Blobs/ConfigurationSchema.json b/src/Components/Aspire.Azure.Storage.Blobs/ConfigurationSchema.json index 5364295053e..24f987cb0d1 100644 --- a/src/Components/Aspire.Azure.Storage.Blobs/ConfigurationSchema.json +++ b/src/Components/Aspire.Azure.Storage.Blobs/ConfigurationSchema.json @@ -35,7 +35,7 @@ "properties": { "ApplicationId": { "type": "string", - "description": "Gets or sets the value sent as the first part of \u0022User-Agent\u0022 headers for all requests issues by this client. Defaults to P:Azure.Core.DiagnosticsOptions.DefaultApplicationId." + "description": "Gets or sets the value sent as the first part of \"User-Agent\" headers for all requests issues by this client. Defaults to P:Azure.Core.DiagnosticsOptions.DefaultApplicationId." }, "DefaultApplicationId": { "type": "string", @@ -55,7 +55,7 @@ }, "IsTelemetryEnabled": { "type": "boolean", - "description": "Gets or sets value indicating whether the \u0022User-Agent\u0022 header containing P:Azure.Core.DiagnosticsOptions.ApplicationId , client library package name and version, P:System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription and P:System.Runtime.InteropServices.RuntimeInformation.OSDescription should be sent.\n The default value can be controlled process wide by setting AZURE_TELEMETRY_DISABLED to true , false , 1 or 0." + "description": "Gets or sets value indicating whether the \"User-Agent\" header containing P:Azure.Core.DiagnosticsOptions.ApplicationId , client library package name and version, P:System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription and P:System.Runtime.InteropServices.RuntimeInformation.OSDescription should be sent.\nThe default value can be controlled process wide by setting AZURE_TELEMETRY_DISABLED to true , false , 1 or 0." }, "LoggedContentSizeLimit": { "type": "integer", @@ -66,7 +66,7 @@ }, "EnableTenantDiscovery": { "type": "boolean", - "description": "Enables tenant discovery through the authorization challenge when the client is configured to use a TokenCredential.\n When enabled, the client will attempt an initial un-authorized request to prompt a challenge in order to discover the correct tenant for the resource." + "description": "Enables tenant discovery through the authorization challenge when the client is configured to use a TokenCredential.\nWhen enabled, the client will attempt an initial un-authorized request to prompt a challenge in order to discover the correct tenant for the resource." }, "EncryptionScope": { "type": "string", @@ -75,7 +75,7 @@ "GeoRedundantSecondaryUri": { "type": "string", "format": "uri", - "description": "Gets or sets the secondary storage T:System.Uri that can be read from for the storage account if the\n account is enabled for RA-GRS.\n \n If this property is set, the secondary Uri will be used for GET or HEAD requests during retries.\n If the status of the response from the secondary Uri is a 404, then subsequent retries for\n the request will not use the secondary Uri again, as this indicates that the resource\n may not have propagated there yet. Otherwise, subsequent retries will alternate back and forth\n between primary and secondary Uri." + "description": "Gets or sets the secondary storage T:System.Uri that can be read from for the storage account if the\naccount is enabled for RA-GRS.\n\nIf this property is set, the secondary Uri will be used for GET or HEAD requests during retries.\nIf the status of the response from the secondary Uri is a 404, then subsequent retries for\nthe request will not use the secondary Uri again, as this indicates that the resource\nmay not have propagated there yet. Otherwise, subsequent retries will alternate back and forth\nbetween primary and secondary Uri." }, "Retry": { "type": "object", @@ -83,12 +83,12 @@ "Delay": { "type": "string", "format": "duration", - "description": "The delay between retry attempts for a fixed approach or the delay\n on which to base calculations for a backoff-based approach.\n If the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." + "description": "The delay between retry attempts for a fixed approach or the delay\non which to base calculations for a backoff-based approach.\nIf the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." }, "MaxDelay": { "type": "string", "format": "duration", - "description": "The maximum permissible delay between retry attempts when the service does not provide a Retry-After response header.\n If the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." + "description": "The maximum permissible delay between retry attempts when the service does not provide a Retry-After response header.\nIf the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." }, "MaxRetries": { "type": "integer", @@ -117,7 +117,7 @@ "properties": { "AutoValidateChecksum": { "type": "boolean", - "description": "Defaults to true. False can only be specified on specific operations and not at the client level.\n Indicates whether the SDK should validate the content\n body against the content hash before returning contents to the caller.\n If set to false, caller is responsible for extracting the hash out\n of the T:Azure.Response\u00601 and validating the hash themselves." + "description": "Defaults to true. False can only be specified on specific operations and not at the client level.\nIndicates whether the SDK should validate the content\nbody against the content hash before returning contents to the caller.\nIf set to false, caller is responsible for extracting the hash out\nof the T:Azure.Response`1 and validating the hash themselves." }, "ChecksumAlgorithm": { "enum": [ @@ -147,14 +147,14 @@ "description": "Options on upload." } }, - "description": "Configures whether to send or receive checksum headers for blob uploads and downloads. Downloads\n can optionally validate that the content matches the checksum." + "description": "Configures whether to send or receive checksum headers for blob uploads and downloads. Downloads\ncan optionally validate that the content matches the checksum." }, "TrimBlobNameSlashes": { "type": "boolean", - "description": "Whether to trim leading and trailing slashes on a blob name when using M:Azure.Storage.Blobs.BlobContainerClient.GetBlobClient(System.String) and similar methods.\n Defaults to true for backwards compatibility." + "description": "Whether to trim leading and trailing slashes on a blob name when using M:Azure.Storage.Blobs.BlobContainerClient.GetBlobClient(System.String) and similar methods.\nDefaults to true for backwards compatibility." } }, - "description": "Provides the client configuration options for connecting to Azure Blob\n Storage." + "description": "Provides the client configuration options for connecting to Azure Blob\nStorage." }, "ConnectionString": { "type": "string", @@ -168,7 +168,7 @@ "ServiceUri": { "type": "string", "format": "uri", - "description": "A T:System.Uri referencing the blob service.\n This is likely to be similar to \u0022https://{account_name}.blob.core.windows.net\u0022." + "description": "A T:System.Uri referencing the blob service.\nThis is likely to be similar to \"https://{account_name}.blob.core.windows.net\"." }, "Tracing": { "type": "boolean", diff --git a/src/Components/Aspire.Azure.Storage.Queues/Aspire.Azure.Storage.Queues.csproj b/src/Components/Aspire.Azure.Storage.Queues/Aspire.Azure.Storage.Queues.csproj index a3aec66cbdc..cbaa8fa4fac 100644 --- a/src/Components/Aspire.Azure.Storage.Queues/Aspire.Azure.Storage.Queues.csproj +++ b/src/Components/Aspire.Azure.Storage.Queues/Aspire.Azure.Storage.Queues.csproj @@ -13,6 +13,7 @@ + diff --git a/src/Components/Aspire.Azure.Storage.Queues/AssemblyInfo.cs b/src/Components/Aspire.Azure.Storage.Queues/AssemblyInfo.cs new file mode 100644 index 00000000000..8b05276196f --- /dev/null +++ b/src/Components/Aspire.Azure.Storage.Queues/AssemblyInfo.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.Azure.Storage.Queues; +using Azure.Storage.Queues; + +[assembly: ConfigurationSchema("Aspire:Azure:Storage:Queues", typeof(AzureStorageQueuesSettings))] +[assembly: ConfigurationSchema("Aspire:Azure:Storage:Queues:ClientOptions", typeof(QueueClientOptions), exclusionPaths: ["Default"])] + +[assembly: LoggingCategories( + "Azure", + "Azure.Core", + "Azure.Identity")] diff --git a/src/Components/Aspire.Azure.Storage.Queues/ConfigurationSchema.json b/src/Components/Aspire.Azure.Storage.Queues/ConfigurationSchema.json index fe8e7d5507b..d13d6e3de40 100644 --- a/src/Components/Aspire.Azure.Storage.Queues/ConfigurationSchema.json +++ b/src/Components/Aspire.Azure.Storage.Queues/ConfigurationSchema.json @@ -27,58 +27,81 @@ "Queues": { "type": "object", "properties": { - "ServiceUri": { - "type": "string", - "format": "uri", - "description": "Gets or sets the 'Uri' referencing the Queue service. This is likely to be similar to \"https://{account_name}.queue.core.windows.net\"." - }, - "HealthChecks": { - "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the Queues Storage health check is enabled or not.", - "default": true - }, - "Tracing": { - "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", - "default": false - }, "ClientOptions": { "type": "object", - "description": "Provides the client configuration options for connecting to Azure Queue Storage.", "properties": { + "Diagnostics": { + "type": "object", + "properties": { + "ApplicationId": { + "type": "string", + "description": "Gets or sets the value sent as the first part of \"User-Agent\" headers for all requests issues by this client. Defaults to P:Azure.Core.DiagnosticsOptions.DefaultApplicationId." + }, + "DefaultApplicationId": { + "type": "string", + "description": "Gets or sets the default application id. Default application id would be set on all instances." + }, + "IsDistributedTracingEnabled": { + "type": "boolean", + "description": "Gets or sets value indicating whether distributed tracing activities ( T:System.Diagnostics.Activity ) are going to be created for the clients methods calls and HTTP calls." + }, + "IsLoggingContentEnabled": { + "type": "boolean", + "description": "Gets or sets value indicating if request or response content should be logged." + }, + "IsLoggingEnabled": { + "type": "boolean", + "description": "Get or sets value indicating whether HTTP pipeline logging is enabled." + }, + "IsTelemetryEnabled": { + "type": "boolean", + "description": "Gets or sets value indicating whether the \"User-Agent\" header containing P:Azure.Core.DiagnosticsOptions.ApplicationId , client library package name and version, P:System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription and P:System.Runtime.InteropServices.RuntimeInformation.OSDescription should be sent.\nThe default value can be controlled process wide by setting AZURE_TELEMETRY_DISABLED to true , false , 1 or 0." + }, + "LoggedContentSizeLimit": { + "type": "integer", + "description": "Gets or sets value indicating maximum size of content to log in bytes. Defaults to 4096." + } + }, + "description": "Gets the client diagnostic options." + }, "EnableTenantDiscovery": { "type": "boolean", - "description": "Enables tenant discovery through the authorization challenge when the client is configured to use a TokenCredential. When enabled, the client will attempt an initial un-authorized request to prompt a challenge in order to discover the correct tenant for the resource." + "description": "Enables tenant discovery through the authorization challenge when the client is configured to use a TokenCredential.\nWhen enabled, the client will attempt an initial un-authorized request to prompt a challenge in order to discover the correct tenant for the resource." }, "GeoRedundantSecondaryUri": { "type": "string", "format": "uri", - "description": "Gets or sets the secondary storage Uri that can be read from for the storage account if the account is enabled for RA-GRS." + "description": "Gets or sets the secondary storage T:System.Uri that can be read from for the storage account if the\naccount is enabled for RA-GRS.\n\nIf this property is set, the secondary Uri will be used for GET or HEAD requests during retries.\nIf the status of the response from the secondary Uri is a 404, then subsequent retries for\nthe request will not use the secondary Uri again, as this indicates that the resource\nmay not have propagated there yet. Otherwise, subsequent retries will alternate back and forth\nbetween primary and secondary Uri." }, "MessageEncoding": { - "enum": [ "None", "Base64" ], - "description": "Gets or sets a message encoding that determines how Body is represented in HTTP requests and responses. The default is None." + "enum": [ + "None", + "Base64" + ], + "description": "Gets or sets a message encoding that determines how P:Azure.Storage.Queues.Models.QueueMessage.Body is represented in HTTP requests and responses.\nThe default is F:Azure.Storage.Queues.QueueMessageEncoding.None." }, "Retry": { "type": "object", - "description": "The set of options that can be specified to influence how retry attempts are made, and a failure is eligible to be retried", "properties": { "Delay": { "type": "string", "format": "duration", - "description": "The delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-based approach. If the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." + "description": "The delay between retry attempts for a fixed approach or the delay\non which to base calculations for a backoff-based approach.\nIf the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." }, "MaxDelay": { "type": "string", "format": "duration", - "description": "The maximum permissible delay between retry attempts when the service does not provide a Retry-After response header. If the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." + "description": "The maximum permissible delay between retry attempts when the service does not provide a Retry-After response header.\nIf the service provides a Retry-After response header, the next retry will be delayed by the duration specified by the header value." }, "MaxRetries": { "type": "integer", "description": "The maximum number of retry attempts before giving up." }, "Mode": { - "enum": [ "Fixed", "Exponential" ], + "enum": [ + "Fixed", + "Exponential" + ], "description": "The approach to use for calculating retry delays." }, "NetworkTimeout": { @@ -86,11 +109,33 @@ "format": "duration", "description": "The timeout applied to an individual network operations." } - } + }, + "description": "Gets the client retry options." } - } + }, + "description": "Provides the client configuration options for connecting to Azure Queue\nStorage" + }, + "ConnectionString": { + "type": "string", + "description": "Gets or sets the connection string used to connect to the blob service." + }, + "HealthChecks": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the Queues Storage health check is enabled or not.", + "default": true + }, + "ServiceUri": { + "type": "string", + "format": "uri", + "description": "A T:System.Uri referencing the queue service.\nThis is likely to be similar to \"https://{account_name}.queue.core.windows.net\"." + }, + "Tracing": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", + "default": true } - } + }, + "description": "Provides the client configuration settings for connecting to Azure Storage Queues." } } } diff --git a/src/Components/Aspire.Microsoft.Azure.Cosmos/Aspire.Microsoft.Azure.Cosmos.csproj b/src/Components/Aspire.Microsoft.Azure.Cosmos/Aspire.Microsoft.Azure.Cosmos.csproj index e41dd949483..d8902e61209 100644 --- a/src/Components/Aspire.Microsoft.Azure.Cosmos/Aspire.Microsoft.Azure.Cosmos.csproj +++ b/src/Components/Aspire.Microsoft.Azure.Cosmos/Aspire.Microsoft.Azure.Cosmos.csproj @@ -10,6 +10,10 @@ $(SharedDir)AzureCosmosDB_256x.png + + + + diff --git a/src/Components/Aspire.Microsoft.Azure.Cosmos/AssemblyInfo.cs b/src/Components/Aspire.Microsoft.Azure.Cosmos/AssemblyInfo.cs new file mode 100644 index 00000000000..15f3108bffb --- /dev/null +++ b/src/Components/Aspire.Microsoft.Azure.Cosmos/AssemblyInfo.cs @@ -0,0 +1,9 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.Microsoft.Azure.Cosmos; + +[assembly: ConfigurationSchema("Aspire:Microsoft:Azure:Cosmos", typeof(AzureCosmosDBSettings))] + +[assembly: LoggingCategories("Azure-Cosmos-Operation-Request-Diagnostics")] diff --git a/src/Components/Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json b/src/Components/Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json index 9ba4f921b4a..1c6a3f88e05 100644 --- a/src/Components/Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json +++ b/src/Components/Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json @@ -21,20 +21,22 @@ "Cosmos": { "type": "object", "properties": { - "ConnectionString": { - "type": "string", - "description": "Gets or sets the connection string of the Azure Cosmos DB to connect to. If both are provided, 'ConnectionString' takes precedence over 'AccountEndpoint'." - }, "AccountEndpoint": { "type": "string", "format": "uri", - "description": "Gets or sets the account endpoint of the Azure Cosmos DB to connect to. If both are provided, 'ConnectionString' takes precedence over 'AccountEndpoint'." + "description": "A T:System.Uri referencing the Azure Cosmos DB Endpoint.\nThis is likely to be similar to \"https://{account_name}.queue.core.windows.net\"." + }, + "ConnectionString": { + "type": "string", + "description": "Gets or sets the connection string of the Azure Cosmos database to connect to." }, "Tracing": { "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not." + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", + "default": true } - } + }, + "description": "The settings relevant to accessing Azure Cosmos DB." } } } @@ -42,5 +44,6 @@ } } } - } + }, + "type": "object" } diff --git a/src/Components/Aspire.Microsoft.Data.SqlClient/Aspire.Microsoft.Data.SqlClient.csproj b/src/Components/Aspire.Microsoft.Data.SqlClient/Aspire.Microsoft.Data.SqlClient.csproj index f4e428e5c1a..71980d1e08b 100644 --- a/src/Components/Aspire.Microsoft.Data.SqlClient/Aspire.Microsoft.Data.SqlClient.csproj +++ b/src/Components/Aspire.Microsoft.Data.SqlClient/Aspire.Microsoft.Data.SqlClient.csproj @@ -9,6 +9,7 @@ + diff --git a/src/Components/Aspire.Microsoft.Data.SqlClient/AssemblyInfo.cs b/src/Components/Aspire.Microsoft.Data.SqlClient/AssemblyInfo.cs new file mode 100644 index 00000000000..647eb17b1a0 --- /dev/null +++ b/src/Components/Aspire.Microsoft.Data.SqlClient/AssemblyInfo.cs @@ -0,0 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.Microsoft.Data.SqlClient; + +[assembly: ConfigurationSchema("Aspire:Microsoft:Data:SqlClient", typeof(MicrosoftDataSqlClientSettings))] diff --git a/src/Components/Aspire.Microsoft.Data.SqlClient/ConfigurationSchema.json b/src/Components/Aspire.Microsoft.Data.SqlClient/ConfigurationSchema.json index 7763f1267c7..382cce44e66 100644 --- a/src/Components/Aspire.Microsoft.Data.SqlClient/ConfigurationSchema.json +++ b/src/Components/Aspire.Microsoft.Data.SqlClient/ConfigurationSchema.json @@ -21,17 +21,18 @@ "description": "Gets or sets a boolean value that indicates whether the database health check is enabled or not.", "default": true }, - "Tracing": { + "Metrics": { "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry metrics are enabled or not.", "default": true }, - "Metrics": { + "Tracing": { "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry metrics are enabled or not.", + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", "default": true } - } + }, + "description": "Provides the client configuration settings for connecting to a SQL Server database using SqlClient." } } } diff --git a/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/Aspire.Microsoft.EntityFrameworkCore.Cosmos.csproj b/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/Aspire.Microsoft.EntityFrameworkCore.Cosmos.csproj index 913d7e60273..9b0b4501861 100644 --- a/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/Aspire.Microsoft.EntityFrameworkCore.Cosmos.csproj +++ b/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/Aspire.Microsoft.EntityFrameworkCore.Cosmos.csproj @@ -10,6 +10,10 @@ $(SharedDir)AzureCosmosDB_256x.png + + + + diff --git a/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/AssemblyInfo.cs b/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/AssemblyInfo.cs new file mode 100644 index 00000000000..9888df1213d --- /dev/null +++ b/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/AssemblyInfo.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.Microsoft.EntityFrameworkCore.Cosmos; + +[assembly: ConfigurationSchema("Aspire:Microsoft:EntityFrameworkCore:Cosmos", typeof(EntityFrameworkCoreCosmosDBSettings))] + +[assembly: LoggingCategories( + "Azure-Cosmos-Operation-Request-Diagnostics", + "Microsoft.EntityFrameworkCore", + "Microsoft.EntityFrameworkCore.ChangeTracking", + "Microsoft.EntityFrameworkCore.Database", + "Microsoft.EntityFrameworkCore.Database.Command", + "Microsoft.EntityFrameworkCore.Infrastructure", + "Microsoft.EntityFrameworkCore.Query")] diff --git a/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json b/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json index 40dc2ae5b25..21dd3cdd01c 100644 --- a/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json +++ b/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json @@ -42,21 +42,15 @@ "AccountEndpoint": { "type": "string", "format": "uri", - "description": "Gets or sets the account endpoint of the Azure Cosmos DB account to connect to. Used along with \"Credential\" to establish the connection." + "description": "A T:System.Uri referencing the Azure Cosmos DB Endpoint.\nThis is likely to be similar to \"https://{account_name}.queue.core.windows.net\"." }, "ConnectionString": { "type": "string", - "description": "Gets or sets the connection string of the Azure Cosmos DB account to connect to." + "description": "The connection string of the Azure Cosmos DB server database to connect to." }, "DbContextPooling": { "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the DbContext will be pooled or explicitly created every time it's requested.", - "default": true - }, - "Tracing": { - "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", - "default": true + "description": "Gets or sets a boolean value that indicates whether the DbContext will be pooled or explicitly created every time it's requested." }, "Metrics": { "type": "boolean", @@ -66,8 +60,14 @@ "Region": { "type": "string", "description": "Gets or sets a string value that indicates what Azure region this client will run in." + }, + "Tracing": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", + "default": true } - } + }, + "description": "The settings relevant to accessing Azure Cosmos DB database using EntityFrameworkCore." } } } diff --git a/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/EntityFrameworkCoreCosmosDBSettings.cs b/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/EntityFrameworkCoreCosmosDBSettings.cs index 9edcf775b6c..2894a04ce7b 100644 --- a/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/EntityFrameworkCoreCosmosDBSettings.cs +++ b/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/EntityFrameworkCoreCosmosDBSettings.cs @@ -31,12 +31,12 @@ public sealed class EntityFrameworkCoreCosmosDBSettings public TokenCredential? Credential { get; set; } /// - /// Gets or sets a boolean value that indicates whether the db context will be pooled or explicitly created every time it's requested. + /// Gets or sets a boolean value that indicates whether the DbContext will be pooled or explicitly created every time it's requested. /// public bool DbContextPooling { get; set; } = true; /// - /// Gets or sets a boolean value that indicates whether the Open Telemetry tracing is enabled or not. + /// Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not. /// /// /// The default value is . @@ -44,7 +44,7 @@ public sealed class EntityFrameworkCoreCosmosDBSettings public bool Tracing { get; set; } = true; /// - /// Gets or sets a boolean value that indicates whether the Open Telemetry metrics are enabled or not. + /// Gets or sets a boolean value that indicates whether the OpenTelemetry metrics are enabled or not. /// /// /// The default value is . diff --git a/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/Aspire.Microsoft.EntityFrameworkCore.SqlServer.csproj b/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/Aspire.Microsoft.EntityFrameworkCore.SqlServer.csproj index cdd0312c576..32ac48c859a 100644 --- a/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/Aspire.Microsoft.EntityFrameworkCore.SqlServer.csproj +++ b/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/Aspire.Microsoft.EntityFrameworkCore.SqlServer.csproj @@ -9,6 +9,7 @@ + diff --git a/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/AssemblyInfo.cs b/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/AssemblyInfo.cs new file mode 100644 index 00000000000..4c432a9a2ed --- /dev/null +++ b/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/AssemblyInfo.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.Microsoft.EntityFrameworkCore.SqlServer; + +[assembly: ConfigurationSchema("Aspire:Microsoft:EntityFrameworkCore:SqlServer", typeof(MicrosoftEntityFrameworkCoreSqlServerSettings))] + +[assembly: LoggingCategories( + "Microsoft.EntityFrameworkCore", + "Microsoft.EntityFrameworkCore.ChangeTracking", + "Microsoft.EntityFrameworkCore.Database", + "Microsoft.EntityFrameworkCore.Database.Command", + "Microsoft.EntityFrameworkCore.Database.Connection", + "Microsoft.EntityFrameworkCore.Database.Transaction", + "Microsoft.EntityFrameworkCore.Infrastructure", + "Microsoft.EntityFrameworkCore.Migrations", + "Microsoft.EntityFrameworkCore.Model", + "Microsoft.EntityFrameworkCore.Model.Validation", + "Microsoft.EntityFrameworkCore.Query", + "Microsoft.EntityFrameworkCore.Update")] diff --git a/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/ConfigurationSchema.json b/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/ConfigurationSchema.json index a41852f2959..26d84060dc2 100644 --- a/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/ConfigurationSchema.json +++ b/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/ConfigurationSchema.json @@ -14,10 +14,10 @@ "Microsoft.EntityFrameworkCore.Database.Command": { "$ref": "#/definitions/logLevelThreshold" }, - "Microsoft.EntityFrameworkCore.Database.Transaction": { + "Microsoft.EntityFrameworkCore.Database.Connection": { "$ref": "#/definitions/logLevelThreshold" }, - "Microsoft.EntityFrameworkCore.Database.Connection": { + "Microsoft.EntityFrameworkCore.Database.Transaction": { "$ref": "#/definitions/logLevelThreshold" }, "Microsoft.EntityFrameworkCore.Infrastructure": { @@ -56,26 +56,20 @@ "properties": { "ConnectionString": { "type": "string", - "description": "Gets or sets the connection string of the SQL Server database to connect to." + "description": "The connection string of the SQL server database to connect to." }, "DbContextPooling": { "type": "boolean", "description": "Gets or sets a boolean value that indicates whether the DbContext will be pooled or explicitly created every time it's requested." }, - "MaxRetryCount": { - "type": "integer", - "description": "Gets or sets the maximum number of retry attempts. Set it to 0 to disable the retry mechanism.", - "default": 6 - }, "HealthChecks": { "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the DbContext health check is enabled or not.", + "description": "Gets or sets a boolean value that indicates whether the database health check is enabled or not.", "default": true }, - "Tracing": { - "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", - "default": true + "MaxRetryCount": { + "type": "integer", + "description": "Gets or sets the maximum number of retry attempts." }, "Metrics": { "type": "boolean", @@ -84,10 +78,15 @@ }, "Timeout": { "type": "integer", - "description": "Gets or sets the time in seconds to wait for the command to execute.", - "default": null + "description": "The time in seconds to wait for the command to execute." + }, + "Tracing": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", + "default": true } - } + }, + "description": "Provides the client configuration settings for connecting to a SQL Server database using EntityFrameworkCore." } } } diff --git a/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/MicrosoftEntityFrameworkCoreSqlServerSettings.cs b/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/MicrosoftEntityFrameworkCoreSqlServerSettings.cs index 766f17567ae..7a224394c4e 100644 --- a/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/MicrosoftEntityFrameworkCoreSqlServerSettings.cs +++ b/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/MicrosoftEntityFrameworkCoreSqlServerSettings.cs @@ -14,7 +14,7 @@ public sealed class MicrosoftEntityFrameworkCoreSqlServerSettings public string? ConnectionString { get; set; } /// - /// Gets or sets a boolean value that indicates whether the db context will be pooled or explicitly created every time it's requested. + /// Gets or sets a boolean value that indicates whether the DbContext will be pooled or explicitly created every time it's requested. /// public bool DbContextPooling { get; set; } = true; @@ -36,7 +36,7 @@ public sealed class MicrosoftEntityFrameworkCoreSqlServerSettings public bool HealthChecks { get; set; } = true; /// - /// Gets or sets a boolean value that indicates whether the Open Telemetry tracing is enabled or not. + /// Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not. /// /// /// The default value is . @@ -44,7 +44,7 @@ public sealed class MicrosoftEntityFrameworkCoreSqlServerSettings public bool Tracing { get; set; } = true; /// - /// Gets or sets a boolean value that indicates whether the Open Telemetry metrics are enabled or not. + /// Gets or sets a boolean value that indicates whether the OpenTelemetry metrics are enabled or not. /// /// /// The default value is . diff --git a/src/Components/Aspire.MongoDB.Driver/Aspire.MongoDB.Driver.csproj b/src/Components/Aspire.MongoDB.Driver/Aspire.MongoDB.Driver.csproj index 4a79836bc01..c1b3bed7405 100644 --- a/src/Components/Aspire.MongoDB.Driver/Aspire.MongoDB.Driver.csproj +++ b/src/Components/Aspire.MongoDB.Driver/Aspire.MongoDB.Driver.csproj @@ -9,6 +9,7 @@ + diff --git a/src/Components/Aspire.MongoDB.Driver/AssemblyInfo.cs b/src/Components/Aspire.MongoDB.Driver/AssemblyInfo.cs new file mode 100644 index 00000000000..e6af6856a45 --- /dev/null +++ b/src/Components/Aspire.MongoDB.Driver/AssemblyInfo.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.MongoDB.Driver; + +[assembly: ConfigurationSchema("Aspire:MongoDB:Driver", typeof(MongoDBSettings))] + +[assembly: LoggingCategories( + "MongoDB", + "MongoDB.Command", + "MongoDB.SDAM", + "MongoDB.ServerSelection", + "MongoDB.Connection", + "MongoDB.Internal")] diff --git a/src/Components/Aspire.MongoDB.Driver/ConfigurationSchema.json b/src/Components/Aspire.MongoDB.Driver/ConfigurationSchema.json index 01e046d85e8..be88c33ceb8 100644 --- a/src/Components/Aspire.MongoDB.Driver/ConfigurationSchema.json +++ b/src/Components/Aspire.MongoDB.Driver/ConfigurationSchema.json @@ -8,16 +8,16 @@ "MongoDB.Command": { "$ref": "#/definitions/logLevelThreshold" }, - "MongoDB.SDAM": { + "MongoDB.Connection": { "$ref": "#/definitions/logLevelThreshold" }, - "MongoDB.ServerSelection": { + "MongoDB.Internal": { "$ref": "#/definitions/logLevelThreshold" }, - "MongoDB.Connection": { + "MongoDB.SDAM": { "$ref": "#/definitions/logLevelThreshold" }, - "MongoDB.Internal": { + "MongoDB.ServerSelection": { "$ref": "#/definitions/logLevelThreshold" } } @@ -37,21 +37,24 @@ "type": "string", "description": "Gets or sets the connection string of the MongoDB database to connect to." }, - "HealthChecks": { - "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the MongoDB health check is enabled or not." - }, "HealthCheckTimeout": { "type": "integer", "description": "Gets or sets a integer value that indicates the MongoDB health check timeout in milliseconds." }, + "HealthChecks": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the MongoDB health check is enabled or not.", + "default": true + }, "Tracing": { "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the Open Telemetry tracing is enabled or not." + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", + "default": true } - } + }, + "description": "Provides the client configuration settings for connecting to a MongoDB database using MongoDB driver." } - } + } } } } diff --git a/src/Components/Aspire.MongoDB.Driver/MongoDBSettings.cs b/src/Components/Aspire.MongoDB.Driver/MongoDBSettings.cs index a824b3167df..5f0de413640 100644 --- a/src/Components/Aspire.MongoDB.Driver/MongoDBSettings.cs +++ b/src/Components/Aspire.MongoDB.Driver/MongoDBSettings.cs @@ -27,7 +27,7 @@ public sealed class MongoDBSettings public int? HealthCheckTimeout { get; set; } /// - /// Gets or sets a boolean value that indicates whether the Open Telemetry tracing is enabled or not. + /// Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not. /// /// /// The default value is . diff --git a/src/Components/Aspire.MySqlConnector/Aspire.MySqlConnector.csproj b/src/Components/Aspire.MySqlConnector/Aspire.MySqlConnector.csproj index 60a775267b1..2cc8d31bd32 100644 --- a/src/Components/Aspire.MySqlConnector/Aspire.MySqlConnector.csproj +++ b/src/Components/Aspire.MySqlConnector/Aspire.MySqlConnector.csproj @@ -9,8 +9,8 @@ - + diff --git a/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.csproj b/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.csproj index 60c2d899d18..bfe830011f2 100644 --- a/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.csproj +++ b/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.csproj @@ -10,6 +10,7 @@ + diff --git a/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/AssemblyInfo.cs b/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/AssemblyInfo.cs new file mode 100644 index 00000000000..5ecd8bc545f --- /dev/null +++ b/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/AssemblyInfo.cs @@ -0,0 +1,21 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.Npgsql.EntityFrameworkCore.PostgreSQL; + +[assembly: ConfigurationSchema("Aspire:Npgsql:EntityFrameworkCore:PostgreSQL", typeof(NpgsqlEntityFrameworkCorePostgreSQLSettings))] + +[assembly: LoggingCategories( + "Microsoft.EntityFrameworkCore", + "Microsoft.EntityFrameworkCore.ChangeTracking", + "Microsoft.EntityFrameworkCore.Database", + "Microsoft.EntityFrameworkCore.Database.Command", + "Microsoft.EntityFrameworkCore.Database.Connection", + "Microsoft.EntityFrameworkCore.Database.Transaction", + "Microsoft.EntityFrameworkCore.Infrastructure", + "Microsoft.EntityFrameworkCore.Migrations", + "Microsoft.EntityFrameworkCore.Model", + "Microsoft.EntityFrameworkCore.Model.Validation", + "Microsoft.EntityFrameworkCore.Query", + "Microsoft.EntityFrameworkCore.Update")] diff --git a/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json b/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json index c70f74d1719..dc14397b64a 100644 --- a/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json +++ b/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json @@ -14,10 +14,10 @@ "Microsoft.EntityFrameworkCore.Database.Command": { "$ref": "#/definitions/logLevelThreshold" }, - "Microsoft.EntityFrameworkCore.Database.Transaction": { + "Microsoft.EntityFrameworkCore.Database.Connection": { "$ref": "#/definitions/logLevelThreshold" }, - "Microsoft.EntityFrameworkCore.Database.Connection": { + "Microsoft.EntityFrameworkCore.Database.Transaction": { "$ref": "#/definitions/logLevelThreshold" }, "Microsoft.EntityFrameworkCore.Infrastructure": { @@ -63,27 +63,27 @@ "description": "Gets or sets a boolean value that indicates whether the DbContext will be pooled or explicitly created every time it's requested.", "default": true }, - "MaxRetryCount": { - "type": "integer", - "description": "Gets or sets the maximum number of retry attempts. Set it to 0 to disable the retry mechanism.", - "default": 6 - }, "HealthChecks": { "type": "boolean", "description": "Gets or sets a boolean value that indicates whether the database health check is enabled or not.", "default": true }, - "Tracing": { - "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", - "default": true + "MaxRetryCount": { + "type": "integer", + "description": "Gets or sets the maximum number of retry attempts. Default value is 6, set it to 0 to disable the retry mechanism." }, "Metrics": { "type": "boolean", "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry metrics are enabled or not.", "default": true + }, + "Tracing": { + "type": "boolean", + "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", + "default": true } - } + }, + "description": "Provides the client configuration settings for connecting to a PostgreSQL database using EntityFrameworkCore." } } } diff --git a/src/Components/Aspire.Npgsql/Aspire.Npgsql.csproj b/src/Components/Aspire.Npgsql/Aspire.Npgsql.csproj index c57ca65fd44..cf17101714b 100644 --- a/src/Components/Aspire.Npgsql/Aspire.Npgsql.csproj +++ b/src/Components/Aspire.Npgsql/Aspire.Npgsql.csproj @@ -9,8 +9,8 @@ - + diff --git a/src/Components/Aspire.RabbitMQ.Client/Aspire.RabbitMQ.Client.csproj b/src/Components/Aspire.RabbitMQ.Client/Aspire.RabbitMQ.Client.csproj index eda37b282cd..878f052a59f 100644 --- a/src/Components/Aspire.RabbitMQ.Client/Aspire.RabbitMQ.Client.csproj +++ b/src/Components/Aspire.RabbitMQ.Client/Aspire.RabbitMQ.Client.csproj @@ -9,6 +9,7 @@ + diff --git a/src/Components/Aspire.RabbitMQ.Client/AssemblyInfo.cs b/src/Components/Aspire.RabbitMQ.Client/AssemblyInfo.cs new file mode 100644 index 00000000000..c44b6dca992 --- /dev/null +++ b/src/Components/Aspire.RabbitMQ.Client/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; +using Aspire.RabbitMQ.Client; +using RabbitMQ.Client; + +[assembly: ConfigurationSchema("Aspire:RabbitMQ:Client", typeof(RabbitMQClientSettings))] +[assembly: ConfigurationSchema("Aspire:RabbitMQ:Client:ConnectionFactory", typeof(ConnectionFactory), exclusionPaths: ["ClientProperties"])] + +[assembly: LoggingCategories("RabbitMQ.Client")] diff --git a/src/Components/Aspire.RabbitMQ.Client/ConfigurationSchema.json b/src/Components/Aspire.RabbitMQ.Client/ConfigurationSchema.json index 2abae9f4aec..976146344be 100644 --- a/src/Components/Aspire.RabbitMQ.Client/ConfigurationSchema.json +++ b/src/Components/Aspire.RabbitMQ.Client/ConfigurationSchema.json @@ -20,55 +20,236 @@ "properties": { "ConnectionFactory": { "type": "object", - "description": "The options relevant for creating a RabbitMQ connection.", "properties": { "AmqpUriSslProtocols": { - "enum": [ "None", "Ssl2", "Ssl3", "Tls", "Default", "Tls11", "Tls12", "Tls13" ], - "description": "TLS versions enabled by default: TLSv1.2, v1.1, v1.0." + "enum": [ + "None", + "Ssl2", + "Ssl3", + "Tls", + "Default", + "Tls11", + "Tls12", + "Tls13" + ], + "description": "The AMQP URI SSL protocols." }, "AutomaticRecoveryEnabled": { "type": "boolean", - "description": "Set to false to disable automatic connection recovery.", - "default": true + "description": "Set to false to disable automatic connection recovery.\nDefaults to true." }, - "DispatchConsumersAsync": { - "type": "boolean", - "description": "Set to true will enable a asynchronous consumer dispatcher which is compatible with IAsyncBasicConsumer.", - "default": false + "ClientProvidedName": { + "type": "string", + "description": "Default client provided name to be used for connections." }, "ConsumerDispatchConcurrency": { "type": "integer", - "description": "Set to a value greater than one to enable concurrent processing. For a concurrency greater than one IBasicConsumer will be offloaded to the worker thread pool so it is important to choose the value for the concurrency wisely to avoid thread pool overloading. IAsyncBasicConsumer can handle concurrency much more efficiently due to the non-blocking nature of the consumer.", - "default": 1 + "description": "Set to a value greater than one to enable concurrent processing. For a concurrency greater than one T:RabbitMQ.Client.IBasicConsumer will be offloaded to the worker thread pool so it is important to choose the value for the concurrency wisely to avoid thread pool overloading. T:RabbitMQ.Client.IAsyncBasicConsumer can handle concurrency much more efficiently due to the non-blocking nature of the consumer.\nDefaults to 1." }, - "HostName": { - "type": "string", - "description": "The host to connect to." - }, - "NetworkRecoveryInterval": { + "ContinuationTimeout": { "type": "string", "format": "duration", - "description": "Amount of time client will wait for before re-trying to recover connection." + "description": "Amount of time protocol operations (e.g. queue.declare ) are allowed to take before\ntiming out." + }, + "DefaultAddressFamily": { + "enum": [ + "Unknown", + "Unspecified", + "Unix", + "InterNetwork", + "ImpLink", + "Pup", + "Chaos", + "Ipx", + "NS", + "Iso", + "Osi", + "Ecma", + "DataKit", + "Ccitt", + "Sna", + "DecNet", + "DataLink", + "Lat", + "HyperChannel", + "AppleTalk", + "NetBios", + "VoiceView", + "FireFox", + "Banyan", + "Atm", + "InterNetworkV6", + "Cluster", + "Ieee12844", + "Irda", + "NetworkDesigners", + "Max", + "Packet", + "ControllerAreaNetwork" + ], + "description": "Address family used by default.\nUse F:System.Net.Sockets.AddressFamily.InterNetwork to force to IPv4.\nUse F:System.Net.Sockets.AddressFamily.InterNetworkV6 to force to IPv6.\nOr use F:System.Net.Sockets.AddressFamily.Unknown to attempt both IPv6 and IPv4." + }, + "DefaultAmqpUriSslProtocols": { + "enum": [ + "None", + "Ssl2", + "Ssl3", + "Tls", + "Default", + "Tls11", + "Tls12", + "Tls13" + ], + "description": "TLS versions enabled by default: TLSv1.2, v1.1, v1.0." + }, + "DispatchConsumersAsync": { + "type": "boolean", + "description": "Set to true will enable a asynchronous consumer dispatcher which is compatible with T:RabbitMQ.Client.IAsyncBasicConsumer .\nDefaults to false." + }, + "Endpoint": { + "type": "object", + "properties": { + "AddressFamily": { + "enum": [ + "Unknown", + "Unspecified", + "Unix", + "InterNetwork", + "ImpLink", + "Pup", + "Chaos", + "Ipx", + "NS", + "Iso", + "Osi", + "Ecma", + "DataKit", + "Ccitt", + "Sna", + "DecNet", + "DataLink", + "Lat", + "HyperChannel", + "AppleTalk", + "NetBios", + "VoiceView", + "FireFox", + "Banyan", + "Atm", + "InterNetworkV6", + "Cluster", + "Ieee12844", + "Irda", + "NetworkDesigners", + "Max", + "Packet", + "ControllerAreaNetwork" + ], + "description": "Used to force the address family of the endpoint.\nUse F:System.Net.Sockets.AddressFamily.InterNetwork to force to IPv4.\nUse F:System.Net.Sockets.AddressFamily.InterNetworkV6 to force to IPv6.\nOr use F:System.Net.Sockets.AddressFamily.Unknown to attempt both IPv6 and IPv4." + }, + "HostName": { + "type": "string", + "description": "Retrieve or set the hostname of this T:RabbitMQ.Client.AmqpTcpEndpoint." + }, + "Port": { + "type": "integer", + "description": "Retrieve or set the port number of this\nAmqpTcpEndpoint. A port number of -1 causes the default\nport number." + }, + "Ssl": { + "type": "object", + "properties": { + "AcceptablePolicyErrors": { + "enum": [ + "None", + "RemoteCertificateNotAvailable", + "RemoteCertificateNameMismatch", + "RemoteCertificateChainErrors" + ], + "description": "Retrieve or set the set of TLS policy (peer verification) errors that are deemed acceptable." + }, + "CertPassphrase": { + "type": "string", + "description": "Retrieve or set the client certificate passphrase." + }, + "CertPath": { + "type": "string", + "description": "Retrieve or set the path to client certificate." + }, + "CheckCertificateRevocation": { + "type": "boolean", + "description": "Attempts to check certificate revocation status. Default is false.\nSet to true to check peer certificate for revocation." + }, + "Enabled": { + "type": "boolean", + "description": "Controls if TLS should indeed be used. Set to false to disable TLS\non the connection." + }, + "ServerName": { + "type": "string", + "description": "Retrieve or set server's expected name.\nThis MUST match the Subject Alternative Name (SAN) or CN on the peer's (server's) leaf certificate,\notherwise the TLS connection will fail." + }, + "Version": { + "enum": [ + "None", + "Ssl2", + "Ssl3", + "Tls", + "Default", + "Tls11", + "Tls12", + "Tls13" + ], + "description": "Retrieve or set the TLS protocol version.\nThe client will let the OS pick a suitable version by using F:System.Security.Authentication.SslProtocols.None .\nIf this option is disabled, e.g.see via app context, the client will attempt to fall back\nto TLSv1.2." + } + }, + "description": "Retrieve the TLS options for this AmqpTcpEndpoint. If not set, null is returned." + } + }, + "description": "Connection endpoint." }, "HandshakeContinuationTimeout": { "type": "string", "format": "duration", - "description": "Amount of time protocol handshake operations are allowed to take before timing out." + "description": "Amount of time protocol handshake operations are allowed to take before\ntiming out." }, - "ContinuationTimeout": { + "HostName": { + "type": "string", + "description": "The host to connect to." + }, + "MaxMessageSize": { + "type": "integer", + "description": "Maximum allowed message size, in bytes, from RabbitMQ.\nCorresponds to the rabbit.max_message_size setting." + }, + "NetworkRecoveryInterval": { "type": "string", "format": "duration", - "description": "Amount of time protocol operations (e.g. queue.declare) are allowed to take before timing out." + "description": "Amount of time client will wait for before re-trying to recover connection." + }, + "Password": { + "type": "string", + "description": "Password to use when authenticating to the server." }, "Port": { "type": "integer", - "description": "The port to connect on. AmqpTcpEndpoint.UseDefaultPort indicates the default for the protocol should be used." + "description": "The port to connect on. F:RabbitMQ.Client.AmqpTcpEndpoint.UseDefaultPort indicates the default for the protocol should be used." + }, + "RequestedChannelMax": { + "type": "integer", + "description": "Maximum channel number to ask for." }, "RequestedConnectionTimeout": { "type": "string", "format": "duration", "description": "Timeout setting for connection attempts." }, + "RequestedFrameMax": { + "type": "integer", + "description": "Frame-max parameter to ask for (in bytes)." + }, + "RequestedHeartbeat": { + "type": "string", + "format": "duration", + "description": "Heartbeat timeout to use when negotiating with the server." + }, "SocketReadTimeout": { "type": "string", "format": "duration", @@ -81,10 +262,14 @@ }, "Ssl": { "type": "object", - "description": "TLS options setting.", "properties": { "AcceptablePolicyErrors": { - "enum": [ "None", "RemoteCertificateNotAvailable", "RemoteCertificateNameMismatch", "RemoteCertificateChainErrors" ], + "enum": [ + "None", + "RemoteCertificateNotAvailable", + "RemoteCertificateNameMismatch", + "RemoteCertificateChainErrors" + ], "description": "Retrieve or set the set of TLS policy (peer verification) errors that are deemed acceptable." }, "CertPassphrase": { @@ -97,89 +282,72 @@ }, "CheckCertificateRevocation": { "type": "boolean", - "description": "Attempts to check certificate revocation status. Default is false. Set to true to check peer certificate for revocation.", - "default": false + "description": "Attempts to check certificate revocation status. Default is false.\nSet to true to check peer certificate for revocation." }, "Enabled": { "type": "boolean", - "description": "Controls if TLS should indeed be used. Set to false to disable TLS on the connection.", - "default": false + "description": "Controls if TLS should indeed be used. Set to false to disable TLS\non the connection." }, "ServerName": { "type": "string", - "description": "Retrieve or set server's expected name. This MUST match the Subject Alternative Name (SAN) or CN on the peer's (server's) leaf certificate, otherwise the TLS connection will fail." + "description": "Retrieve or set server's expected name.\nThis MUST match the Subject Alternative Name (SAN) or CN on the peer's (server's) leaf certificate,\notherwise the TLS connection will fail." }, "Version": { - "enum": [ "None", "Ssl2", "Ssl3", "Tls", "Default", "Tls11", "Tls12", "Tls13" ], - "description": "Retrieve or set the TLS protocol version. The client will let the OS pick a suitable version by using SslProtocols.None. If this option is disabled, e.g.see via app context, the client will attempt to fall back to TLSv1.2." + "enum": [ + "None", + "Ssl2", + "Ssl3", + "Tls", + "Default", + "Tls11", + "Tls12", + "Tls13" + ], + "description": "Retrieve or set the TLS protocol version.\nThe client will let the OS pick a suitable version by using F:System.Security.Authentication.SslProtocols.None .\nIf this option is disabled, e.g.see via app context, the client will attempt to fall back\nto TLSv1.2." } - } + }, + "description": "TLS options setting." }, "TopologyRecoveryEnabled": { "type": "boolean", - "description": "Set to false to make automatic connection recovery not recover topology (exchanges, queues, bindings, etc).", - "default": true + "description": "Set to false to make automatic connection recovery not recover topology (exchanges, queues, bindings, etc).\nDefaults to true." }, - "UserName": { - "type": "string", - "description": "Username to use when authenticating to the server." - }, - "Password": { + "Uri": { "type": "string", - "description": "Password to use when authenticating to the server." - }, - "RequestedChannelMax": { - "type": "integer", - "description": "Maximum channel number to ask for." - }, - "RequestedFrameMax": { - "type": "integer", - "description": "Frame-max parameter to ask for (in bytes)." + "format": "uri", + "description": "The uri to use for the connection." }, - "RequestedHeartbeat": { + "UserName": { "type": "string", - "format": "duration", - "description": "Heartbeat timeout to use when negotiating with the server." + "description": "Username to use when authenticating to the server." }, "VirtualHost": { "type": "string", "description": "Virtual host to access during this connection." - }, - "MaxMessageSize": { - "type": "integer", - "description": "Maximum allowed message size, in bytes, from RabbitMQ. Corresponds to the rabbit.max_message_size setting." - }, - "Uri": { - "type": "string", - "format": "uri", - "description": "The uri to use for the connection." - }, - "ClientProvidedName": { - "type": "string", - "description": "Default client provided name to be used for connections." } - } + }, + "description": "Main entry point to the RabbitMQ .NET AMQP client\nAPI. Constructs T:RabbitMQ.Client.IConnection instances." }, "ConnectionString": { "type": "string", "description": "Gets or sets the connection string of the RabbitMQ server to connect to." }, - "MaxConnectRetryCount": { - "type": "integer", - "description": "Gets or sets the maximum number of connect retry attempts. Set it to 0 to disable the retry mechanism.", - "default": 5 - }, "HealthChecks": { "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the database health check is enabled or not.", + "description": "Gets or sets a boolean value that indicates whether the RabbitMQ health check is enabled or not.", "default": true }, + "MaxConnectRetryCount": { + "type": "integer", + "description": "Gets or sets the maximum number of connection retry attempts. Default value is 5, set it to 0 to disable the retry mechanism." + }, "Tracing": { "type": "boolean", "description": "Gets or sets a boolean value that indicates whether the OpenTelemetry tracing is enabled or not.", "default": true } - } + }, + "description": "Provides the client configuration settings for connecting to a RabbitMQ message broker." } } } diff --git a/src/Components/Aspire.StackExchange.Redis.DistributedCaching/Aspire.StackExchange.Redis.DistributedCaching.csproj b/src/Components/Aspire.StackExchange.Redis.DistributedCaching/Aspire.StackExchange.Redis.DistributedCaching.csproj index 0f66c2b65c2..b0e08602136 100644 --- a/src/Components/Aspire.StackExchange.Redis.DistributedCaching/Aspire.StackExchange.Redis.DistributedCaching.csproj +++ b/src/Components/Aspire.StackExchange.Redis.DistributedCaching/Aspire.StackExchange.Redis.DistributedCaching.csproj @@ -8,6 +8,10 @@ $(SharedDir)redis-cube-red_white-rgb.png + + + + diff --git a/src/Components/Aspire.StackExchange.Redis.DistributedCaching/AssemblyInfo.cs b/src/Components/Aspire.StackExchange.Redis.DistributedCaching/AssemblyInfo.cs new file mode 100644 index 00000000000..96fbbc73988 --- /dev/null +++ b/src/Components/Aspire.StackExchange.Redis.DistributedCaching/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; + +[assembly: LoggingCategories("Microsoft.Extensions.Caching.StackExchangeRedis")] diff --git a/src/Components/Aspire.StackExchange.Redis.DistributedCaching/ConfigurationSchema.json b/src/Components/Aspire.StackExchange.Redis.DistributedCaching/ConfigurationSchema.json index c817b32e6dd..cb40d9f7476 100644 --- a/src/Components/Aspire.StackExchange.Redis.DistributedCaching/ConfigurationSchema.json +++ b/src/Components/Aspire.StackExchange.Redis.DistributedCaching/ConfigurationSchema.json @@ -8,7 +8,6 @@ } } }, - "properties": { - }, + "properties": {}, "type": "object" } diff --git a/src/Components/Aspire.StackExchange.Redis.OutputCaching/Aspire.StackExchange.Redis.OutputCaching.csproj b/src/Components/Aspire.StackExchange.Redis.OutputCaching/Aspire.StackExchange.Redis.OutputCaching.csproj index 14cebc21f52..b6269b480a7 100644 --- a/src/Components/Aspire.StackExchange.Redis.OutputCaching/Aspire.StackExchange.Redis.OutputCaching.csproj +++ b/src/Components/Aspire.StackExchange.Redis.OutputCaching/Aspire.StackExchange.Redis.OutputCaching.csproj @@ -8,6 +8,10 @@ $(SharedDir)redis-cube-red_white-rgb.png + + + + diff --git a/src/Components/Aspire.StackExchange.Redis.OutputCaching/AssemblyInfo.cs b/src/Components/Aspire.StackExchange.Redis.OutputCaching/AssemblyInfo.cs new file mode 100644 index 00000000000..1a5a539ac0e --- /dev/null +++ b/src/Components/Aspire.StackExchange.Redis.OutputCaching/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Aspire; + +[assembly: LoggingCategories("Microsoft.AspNetCore.OutputCaching.StackExchangeRedis")] diff --git a/src/Components/Aspire.StackExchange.Redis.OutputCaching/ConfigurationSchema.json b/src/Components/Aspire.StackExchange.Redis.OutputCaching/ConfigurationSchema.json index 7354bdc8925..9149620899f 100644 --- a/src/Components/Aspire.StackExchange.Redis.OutputCaching/ConfigurationSchema.json +++ b/src/Components/Aspire.StackExchange.Redis.OutputCaching/ConfigurationSchema.json @@ -8,7 +8,6 @@ } } }, - "properties": { - }, + "properties": {}, "type": "object" } diff --git a/src/Components/Aspire.StackExchange.Redis/ConfigurationSchema.json b/src/Components/Aspire.StackExchange.Redis/ConfigurationSchema.json index c7407d12503..78b08a0fc48 100644 --- a/src/Components/Aspire.StackExchange.Redis/ConfigurationSchema.json +++ b/src/Components/Aspire.StackExchange.Redis/ConfigurationSchema.json @@ -78,7 +78,7 @@ "HeartbeatInterval": { "type": "string", "format": "duration", - "description": "Controls how often the connection heartbeats. A heartbeat includes:\n - Evaluating if any messages have timed out\n - Evaluating connection status (checking for failures)\n - Sending a server message to keep the connection alive if needed" + "description": "Controls how often the connection heartbeats. A heartbeat includes:\n- Evaluating if any messages have timed out\n- Evaluating connection status (checking for failures)\n- Sending a server message to keep the connection alive if needed" }, "IncludeDetailInExceptions": { "type": "boolean", @@ -90,11 +90,11 @@ }, "KeepAlive": { "type": "integer", - "description": "Specifies the time in seconds at which connections should be pinged to ensure validity.\n -1 Defaults to 60 Seconds" + "description": "Specifies the time in seconds at which connections should be pinged to ensure validity.\n-1 Defaults to 60 Seconds" }, "LibraryName": { "type": "string", - "description": "Gets or sets the library name to use for CLIENT SETINFO lib-name calls to Redis during handshake.\n Defaults to \u0022SE.Redis\u0022." + "description": "Gets or sets the library name to use for CLIENT SETINFO lib-name calls to Redis during handshake.\nDefaults to \"SE.Redis\"." }, "Password": { "type": "string", @@ -117,7 +117,7 @@ }, "ResolveDns": { "type": "boolean", - "description": "Indicates whether endpoints should be resolved via DNS before connecting.\n If enabled the ConnectionMultiplexer will not re-resolve DNS when attempting to re-connect after a connection failure." + "description": "Indicates whether endpoints should be resolved via DNS before connecting.\nIf enabled the ConnectionMultiplexer will not re-resolve DNS when attempting to re-connect after a connection failure." }, "ServiceName": { "type": "string", diff --git a/src/Tools/ConfigurationSchemaGenerator/ConfigSchemaEmitter.cs b/src/Tools/ConfigurationSchemaGenerator/ConfigSchemaEmitter.cs index 77e6a81c8c5..a3158a86f97 100644 --- a/src/Tools/ConfigurationSchemaGenerator/ConfigSchemaEmitter.cs +++ b/src/Tools/ConfigurationSchemaGenerator/ConfigSchemaEmitter.cs @@ -3,9 +3,11 @@ using System.Diagnostics; using System.Text; +using System.Text.Encodings.Web; using System.Text.Json; using System.Text.Json.Nodes; using System.Text.Json.Serialization; +using System.Text.RegularExpressions; using System.Xml.Linq; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.DotnetRuntime.Extensions; @@ -13,20 +15,18 @@ namespace ConfigurationSchemaGenerator; -internal sealed class ConfigSchemaEmitter(SchemaGenerationSpec spec, Compilation compilation) +internal sealed partial class ConfigSchemaEmitter(SchemaGenerationSpec spec, Compilation compilation) { private readonly TypeIndex _typeIndex = new TypeIndex(spec.AllTypes); private readonly Compilation _compilation = compilation; private readonly Stack _visitedTypes = new(); private readonly string[] _exclusionPaths = CreateExclusionPaths(spec.ExclusionPaths); + [GeneratedRegex(@"( *)\r?\n( *)")] + private static partial Regex Indentation(); + public string GenerateSchema() { - if (spec == null || spec.ConfigurationTypes.Count == 0) - { - return string.Empty; - } - var root = new JsonObject(); GenerateLogCategories(root); root["properties"] = GenerateGraph(); @@ -36,7 +36,9 @@ public string GenerateSchema() { WriteIndented = true, // ensure the properties are ordered correctly - Converters = { SchemaOrderJsonNodeConverter.Instance } + Converters = { SchemaOrderJsonNodeConverter.Instance }, + // prevent known escaped characters from being \uxxxx encoded + Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping }; return JsonSerializer.Serialize(root, options); } @@ -68,18 +70,21 @@ private void GenerateLogCategories(JsonObject parent) private JsonObject GenerateGraph() { - if (spec.ConfigurationTypes.Count != spec.ConfigurationPaths.Count) - { - throw new InvalidOperationException("Ensure Types and ConfigurationPaths are the same length."); - } - var root = new JsonObject(); - for (var i = 0; i < spec.ConfigurationPaths.Count; i++) + if (spec.ConfigurationTypes.Count > 0) { - var type = spec.ConfigurationTypes[i]; - var path = spec.ConfigurationPaths[i]; + if (spec.ConfigurationTypes.Count != spec.ConfigurationPaths.Count) + { + throw new InvalidOperationException("Ensure Types and ConfigurationPaths are the same length."); + } - GenerateProperties(root, type, path); + for (var i = 0; i < spec.ConfigurationPaths.Count; i++) + { + var type = spec.ConfigurationTypes[i]; + var path = spec.ConfigurationPaths[i]; + + GenerateProperties(root, type, path); + } } return root; @@ -133,20 +138,25 @@ private void GenerateProperties(JsonObject currentNode, TypeSpec type) var propertySymbol = GetPropertySymbol(type, property); var propertyNode = new JsonObject(); + currentNode[property.Name] = propertyNode; + AppendTypeNodes(propertyNode, propertyTypeSpec); if (propertyTypeSpec is ComplexTypeSpec complexPropertyTypeSpec) { var innerPropertiesNode = new JsonObject(); + propertyNode["properties"] = innerPropertiesNode; + GenerateProperties(innerPropertiesNode, complexPropertyTypeSpec); - if (innerPropertiesNode.Count > 0) + if (innerPropertiesNode.Count == 0) { - propertyNode["properties"] = innerPropertiesNode; + propertyNode.Remove("properties"); } } if (ShouldSkipProperty(propertyNode, property, propertyTypeSpec, propertySymbol)) { + currentNode.Remove(property.Name); continue; } @@ -155,8 +165,6 @@ private void GenerateProperties(JsonObject currentNode, TypeSpec type) { GenerateDocCommentsProperties(propertyNode, docComment); } - - currentNode[property.Name] = propertyNode; } } } @@ -189,10 +197,11 @@ private static bool ShouldSkipProperty(JsonObject propertyNode, PropertySpec pro } // skip empty objects - if (propertyNode["type"] is JsonValue typeValue && - typeValue.TryGetValue(out var typeValueString) && - typeValueString == "object" && - propertyNode["properties"] is null) + if (propertyNode.Count == 0 || + (propertyNode["type"] is JsonValue typeValue && + typeValue.TryGetValue(out var typeValueString) && + typeValueString == "object" && + propertyNode["properties"] is null)) { return true; } @@ -232,12 +241,9 @@ private static void GenerateDocCommentsProperties(JsonObject propertyNode, strin { var value = node.ToString().Trim(); AppendSpaceIfNecessary(builder, value); - builder.Append(value); + AppendUnindentedValue(builder, value); } - // normalize line endings - builder.Replace("\r\n", "\n"); - propertyNode["description"] = builder.ToString(); } @@ -323,6 +329,29 @@ private static void AppendSpaceIfNecessary(StringBuilder builder, string value) } } + internal static void AppendUnindentedValue(StringBuilder builder, string value) + { + var index = 0; + + foreach (var match in Indentation().EnumerateMatches(value)) + { + if (match.Index > index) + { + builder.Append(value, index, match.Index - index); + } + + builder.Append('\n'); + index = match.Index + match.Length; + } + + var remaining = value.Length - index; + + if (remaining > 0) + { + builder.Append(value, index, remaining); + } + } + private void AppendTypeNodes(JsonObject propertyNode, TypeSpec propertyTypeSpec) { if (propertyTypeSpec is ParsableFromStringSpec parsable) @@ -342,6 +371,11 @@ private void AppendTypeNodes(JsonObject propertyNode, TypeSpec propertyTypeSpec) { AppendTypeNodes(propertyNode, _typeIndex.GetTypeSpec(nullable.EffectiveTypeRef)); } + else if (propertyTypeSpec is UnsupportedTypeSpec unsupported && + unsupported.NotSupportedReason == NotSupportedReason.CollectionNotSupported) + { + // skip unsupported collections + } else { throw new InvalidOperationException($"Unknown type {propertyTypeSpec}"); @@ -385,7 +419,10 @@ private void AppendParsableFromString(JsonObject propertyNode, ParsableFromStrin private static string GetParsableTypeName(ParsableFromStringSpec parsable) => parsable.DisplayString switch { "bool" => "boolean", + "short" => "integer", + "ushort" => "integer", "int" => "integer", + "uint" => "integer", "long" => "integer", "string" => "string", "Version" => "string", diff --git a/src/Tools/ConfigurationSchemaGenerator/ConfigSchemaGenerator.cs b/src/Tools/ConfigurationSchemaGenerator/ConfigSchemaGenerator.cs index a57f0f02a96..a1840e99faf 100644 --- a/src/Tools/ConfigurationSchemaGenerator/ConfigSchemaGenerator.cs +++ b/src/Tools/ConfigurationSchemaGenerator/ConfigSchemaGenerator.cs @@ -89,7 +89,7 @@ private static PortableExecutableReference CreateMetadataReference(string path) } } - if (types == null && configurationPaths == null) + if (types == null && logCategories == null) { return null; } @@ -100,5 +100,5 @@ private static PortableExecutableReference CreateMetadataReference(string path) /// /// Data about configuration schema directly from the ConfigurationSchemaAttribute. /// - internal sealed record ConfigSchemaAttributeInfo(List Types, List ConfigurationPaths, List? ExclusionPaths, List? LogCategories); + internal sealed record ConfigSchemaAttributeInfo(List? Types, List? ConfigurationPaths, List? ExclusionPaths, List? LogCategories); } diff --git a/src/Tools/ConfigurationSchemaGenerator/ConfigurationBindingGenerator.ForSchemaGeneration.cs b/src/Tools/ConfigurationSchemaGenerator/ConfigurationBindingGenerator.ForSchemaGeneration.cs index accbcf6662e..fa33ce2042b 100644 --- a/src/Tools/ConfigurationSchemaGenerator/ConfigurationBindingGenerator.ForSchemaGeneration.cs +++ b/src/Tools/ConfigurationSchemaGenerator/ConfigurationBindingGenerator.ForSchemaGeneration.cs @@ -40,12 +40,15 @@ public Parser(ConfigSchemaAttributeInfo configSchemaInfo, KnownTypeSymbols typeS public SchemaGenerationSpec? GetSchemaGenerationSpec(CancellationToken cancellationToken) { var types = new List(); - foreach (var type in _configSchemaInfo.Types) + if (_configSchemaInfo.Types is not null) { - var typeParseInfo = TypeParseInfo.Create(type, MethodsToGen.None, invocation: null); + foreach (var type in _configSchemaInfo.Types) + { + var typeParseInfo = TypeParseInfo.Create(type, MethodsToGen.None, invocation: null); - _typesToParse.Enqueue(typeParseInfo); - types.Add(CreateTopTypeSpec(cancellationToken)); + _typesToParse.Enqueue(typeParseInfo); + types.Add(CreateTopTypeSpec(cancellationToken)); + } } return new SchemaGenerationSpec diff --git a/src/Tools/ConfigurationSchemaGenerator/ConfigurationSchemaGenerator.csproj b/src/Tools/ConfigurationSchemaGenerator/ConfigurationSchemaGenerator.csproj index 38ebe37e5b4..67c9b59c4a2 100644 --- a/src/Tools/ConfigurationSchemaGenerator/ConfigurationSchemaGenerator.csproj +++ b/src/Tools/ConfigurationSchemaGenerator/ConfigurationSchemaGenerator.csproj @@ -13,6 +13,8 @@ + + diff --git a/src/Tools/ConfigurationSchemaGenerator/SchemaGenerationSpec.cs b/src/Tools/ConfigurationSchemaGenerator/SchemaGenerationSpec.cs index 220c1a08648..623bd586caf 100644 --- a/src/Tools/ConfigurationSchemaGenerator/SchemaGenerationSpec.cs +++ b/src/Tools/ConfigurationSchemaGenerator/SchemaGenerationSpec.cs @@ -9,7 +9,7 @@ namespace ConfigurationSchemaGenerator; public sealed record SchemaGenerationSpec { public required List ConfigurationTypes { get; init; } - public required List ConfigurationPaths { get; init; } + public required List? ConfigurationPaths { get; init; } public required List? ExclusionPaths { get; init; } public required List? LogCategories { get; init; } public required ImmutableEquatableArray AllTypes { get; init; } diff --git a/tests/ConfigurationSchemaGenerator.Tests/ConfigurationSchemaGenerator.Tests.csproj b/tests/ConfigurationSchemaGenerator.Tests/ConfigurationSchemaGenerator.Tests.csproj new file mode 100644 index 00000000000..cbe71350b56 --- /dev/null +++ b/tests/ConfigurationSchemaGenerator.Tests/ConfigurationSchemaGenerator.Tests.csproj @@ -0,0 +1,16 @@ + + + + $(NetCurrent) + + + + + + + + + + + + diff --git a/tests/ConfigurationSchemaGenerator.Tests/GeneratorTests.cs b/tests/ConfigurationSchemaGenerator.Tests/GeneratorTests.cs new file mode 100644 index 00000000000..a3d33716a7c --- /dev/null +++ b/tests/ConfigurationSchemaGenerator.Tests/GeneratorTests.cs @@ -0,0 +1,40 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Text; +using Xunit; + +namespace ConfigurationSchemaGenerator.Tests; + +public class GeneratorTests +{ + [Theory] + [InlineData("abc\n def", "abc\ndef")] + [InlineData("\n def", "\ndef")] + [InlineData(" \n def", "\ndef")] + [InlineData(" \n def", "\ndef")] + [InlineData("abc\n", "abc\n")] + [InlineData("abc\n ", "abc\n")] + [InlineData("abc\n ", "abc\n")] + [InlineData("abc\n\n ", "abc\n\n")] + [InlineData("\n\n def", "\n\ndef")] + [InlineData("abc\n def \n ghi", "abc\ndef\nghi")] + [InlineData("abc\r\n def", "abc\ndef")] + [InlineData("\r\n def", "\ndef")] + [InlineData(" \r\n def", "\ndef")] + [InlineData(" \r\n def", "\ndef")] + [InlineData("abc\r\n", "abc\n")] + [InlineData("abc\r\n ", "abc\n")] + [InlineData("abc\r\n ", "abc\n")] + [InlineData("abc\r\n\r\n ", "abc\n\n")] + [InlineData("\r\n\r\n def", "\n\ndef")] + [InlineData("abc\r\n def \r\n ghi", "abc\ndef\nghi")] + public void ShouldRemoveIndentation(string value, string expected) + { + var builder = new StringBuilder(); + + ConfigSchemaEmitter.AppendUnindentedValue(builder, value); + + Assert.Equal(expected, builder.ToString()); + } +}