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/ConfigurationSchema.json b/src/Components/Aspire.Azure.Data.Tables/ConfigurationSchema.json index 3a189cffb01..dc5c8ccf367 100644 --- a/src/Components/Aspire.Azure.Data.Tables/ConfigurationSchema.json +++ b/src/Components/Aspire.Azure.Data.Tables/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 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", @@ -74,12 +74,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", @@ -115,7 +115,7 @@ "ServiceUri": { "type": "string", "format": "uri", - "description": "A T:System.Uri referencing the table service account.\n This is likely to be similar to \u0022https://{account_name}.table.core.windows.net/\u0022 or \u0022https://{account_name}.table.cosmos.azure.com/\u0022." + "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", diff --git a/src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json b/src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json index e4a6e82b4c1..4d6f91c5793 100644 --- a/src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json +++ b/src/Components/Aspire.Azure.Messaging.ServiceBus/ConfigurationSchema.json @@ -36,20 +36,20 @@ "ConnectionIdleTimeout": { "type": "string", "format": "duration", - "description": "The amount of time to allow a connection to have no observed traffic before considering\n 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\n 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\n 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 T:Azure.Messaging.ServiceBus.ServiceBusClient ID to identify the client. This can be used to correlate logs\n 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", @@ -57,7 +57,7 @@ "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." + "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", @@ -66,7 +66,7 @@ }, "MaxRetries": { "type": "integer", - "description": "The maximum number of retry attempts before considering the associated operation\n to have failed." + "description": "The maximum number of retry attempts before considering the associated operation\nto have failed." }, "Mode": { "enum": [ @@ -78,17 +78,17 @@ "TryTimeout": { "type": "string", "format": "duration", - "description": "The maximum duration to wait for completion of a single attempt, whether the initial\n 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,\n if so, the amount of time to wait between retry attempts. These options also control the\n amount of time allowed for the individual network operations used for interactions with the Service Bus service." + "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\n service." + "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." diff --git a/src/Components/Aspire.Azure.Security.KeyVault/ConfigurationSchema.json b/src/Components/Aspire.Azure.Security.KeyVault/ConfigurationSchema.json index 230ce04cde5..17e335b5a9e 100644 --- a/src/Components/Aspire.Azure.Security.KeyVault/ConfigurationSchema.json +++ b/src/Components/Aspire.Azure.Security.KeyVault/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", @@ -74,12 +74,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", @@ -116,7 +116,7 @@ "VaultUri": { "type": "string", "format": "uri", - "description": "A T:System.Uri to the vault on which the client operates. Appears as \u0022DNS Name\u0022 in the Azure portal.\n If 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.\n You should validate that this URI references a valid Key Vault resource. See https://aka.ms/azsdk/blog/vault-uri for details." + "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/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/ConfigurationSchema.json b/src/Components/Aspire.Azure.Storage.Queues/ConfigurationSchema.json index 4e07eded66e..d13d6e3de40 100644 --- a/src/Components/Aspire.Azure.Storage.Queues/ConfigurationSchema.json +++ b/src/Components/Aspire.Azure.Storage.Queues/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,19 +66,19 @@ }, "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." }, "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." }, "MessageEncoding": { "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.\n The default is F:Azure.Storage.Queues.QueueMessageEncoding.None." + "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", @@ -86,12 +86,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", @@ -113,7 +113,7 @@ "description": "Gets the client retry options." } }, - "description": "Provides the client configuration options for connecting to Azure Queue\n Storage" + "description": "Provides the client configuration options for connecting to Azure Queue\nStorage" }, "ConnectionString": { "type": "string", @@ -127,7 +127,7 @@ "ServiceUri": { "type": "string", "format": "uri", - "description": "A T:System.Uri referencing the queue service.\n This is likely to be similar to \u0022https://{account_name}.queue.core.windows.net\u0022." + "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", diff --git a/src/Components/Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json b/src/Components/Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json index 189eab57b7d..1c6a3f88e05 100644 --- a/src/Components/Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json +++ b/src/Components/Aspire.Microsoft.Azure.Cosmos/ConfigurationSchema.json @@ -24,7 +24,7 @@ "AccountEndpoint": { "type": "string", "format": "uri", - "description": "A T:System.Uri referencing the Azure Cosmos DB Endpoint.\n This is likely to be similar to \u0022https://{account_name}.queue.core.windows.net\u0022." + "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", diff --git a/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json b/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json index 015a64fc51d..21dd3cdd01c 100644 --- a/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json +++ b/src/Components/Aspire.Microsoft.EntityFrameworkCore.Cosmos/ConfigurationSchema.json @@ -42,7 +42,7 @@ "AccountEndpoint": { "type": "string", "format": "uri", - "description": "A T:System.Uri referencing the Azure Cosmos DB Endpoint.\n This is likely to be similar to \u0022https://{account_name}.queue.core.windows.net\u0022." + "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", @@ -50,7 +50,7 @@ }, "DbContextPooling": { "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the DbContext will be pooled or explicitly created every time it\u0027s requested." + "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", diff --git a/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/ConfigurationSchema.json b/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/ConfigurationSchema.json index e53e3840839..26d84060dc2 100644 --- a/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/ConfigurationSchema.json +++ b/src/Components/Aspire.Microsoft.EntityFrameworkCore.SqlServer/ConfigurationSchema.json @@ -60,7 +60,7 @@ }, "DbContextPooling": { "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the DbContext will be pooled or explicitly created every time it\u0027s requested." + "description": "Gets or sets a boolean value that indicates whether the DbContext will be pooled or explicitly created every time it's requested." }, "HealthChecks": { "type": "boolean", diff --git a/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json b/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json index 983ea3b5ec8..dc14397b64a 100644 --- a/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json +++ b/src/Components/Aspire.Npgsql.EntityFrameworkCore.PostgreSQL/ConfigurationSchema.json @@ -60,7 +60,7 @@ }, "DbContextPooling": { "type": "boolean", - "description": "Gets or sets a boolean value that indicates whether the DbContext will be pooled or explicitly created every time it\u0027s requested.", + "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 }, "HealthChecks": { diff --git a/src/Components/Aspire.RabbitMQ.Client/ConfigurationSchema.json b/src/Components/Aspire.RabbitMQ.Client/ConfigurationSchema.json index 4601e88da03..976146344be 100644 --- a/src/Components/Aspire.RabbitMQ.Client/ConfigurationSchema.json +++ b/src/Components/Aspire.RabbitMQ.Client/ConfigurationSchema.json @@ -36,7 +36,7 @@ }, "AutomaticRecoveryEnabled": { "type": "boolean", - "description": "Set to false to disable automatic connection recovery.\n Defaults to true." + "description": "Set to false to disable automatic connection recovery.\nDefaults to true." }, "ClientProvidedName": { "type": "string", @@ -44,12 +44,12 @@ }, "ConsumerDispatchConcurrency": { "type": "integer", - "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.\n Defaults to 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." }, "ContinuationTimeout": { "type": "string", "format": "duration", - "description": "Amount of time protocol operations (e.g. queue.declare ) are allowed to take before\n timing out." + "description": "Amount of time protocol operations (e.g. queue.declare ) are allowed to take before\ntiming out." }, "DefaultAddressFamily": { "enum": [ @@ -87,7 +87,7 @@ "Packet", "ControllerAreaNetwork" ], - "description": "Address family used by default.\n Use F:System.Net.Sockets.AddressFamily.InterNetwork to force to IPv4.\n Use F:System.Net.Sockets.AddressFamily.InterNetworkV6 to force to IPv6.\n Or use F:System.Net.Sockets.AddressFamily.Unknown to attempt both IPv6 and IPv4." + "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": [ @@ -104,7 +104,7 @@ }, "DispatchConsumersAsync": { "type": "boolean", - "description": "Set to true will enable a asynchronous consumer dispatcher which is compatible with T:RabbitMQ.Client.IAsyncBasicConsumer .\n Defaults to false." + "description": "Set to true will enable a asynchronous consumer dispatcher which is compatible with T:RabbitMQ.Client.IAsyncBasicConsumer .\nDefaults to false." }, "Endpoint": { "type": "object", @@ -145,7 +145,7 @@ "Packet", "ControllerAreaNetwork" ], - "description": "Used to force the address family of the endpoint.\n Use F:System.Net.Sockets.AddressFamily.InterNetwork to force to IPv4.\n Use F:System.Net.Sockets.AddressFamily.InterNetworkV6 to force to IPv6.\n Or use F:System.Net.Sockets.AddressFamily.Unknown to attempt both IPv6 and IPv4." + "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", @@ -153,7 +153,7 @@ }, "Port": { "type": "integer", - "description": "Retrieve or set the port number of this\n AmqpTcpEndpoint. A port number of -1 causes the default\n port number." + "description": "Retrieve or set the port number of this\nAmqpTcpEndpoint. A port number of -1 causes the default\nport number." }, "Ssl": { "type": "object", @@ -177,15 +177,15 @@ }, "CheckCertificateRevocation": { "type": "boolean", - "description": "Attempts to check certificate revocation status. Default is false.\n Set to true to check peer certificate for revocation." + "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\n on the connection." + "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\u0027s expected name.\n This MUST match the Subject Alternative Name (SAN) or CN on the peer\u0027s (server\u0027s) leaf certificate,\n 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": [ @@ -198,7 +198,7 @@ "Tls12", "Tls13" ], - "description": "Retrieve or set the TLS protocol version.\n The client will let the OS pick a suitable version by using F:System.Security.Authentication.SslProtocols.None .\n If this option is disabled, e.g.see via app context, the client will attempt to fall back\n to TLSv1.2." + "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." @@ -209,7 +209,7 @@ "HandshakeContinuationTimeout": { "type": "string", "format": "duration", - "description": "Amount of time protocol handshake operations are allowed to take before\n timing out." + "description": "Amount of time protocol handshake operations are allowed to take before\ntiming out." }, "HostName": { "type": "string", @@ -217,7 +217,7 @@ }, "MaxMessageSize": { "type": "integer", - "description": "Maximum allowed message size, in bytes, from RabbitMQ.\n Corresponds to the rabbit.max_message_size setting." + "description": "Maximum allowed message size, in bytes, from RabbitMQ.\nCorresponds to the rabbit.max_message_size setting." }, "NetworkRecoveryInterval": { "type": "string", @@ -282,15 +282,15 @@ }, "CheckCertificateRevocation": { "type": "boolean", - "description": "Attempts to check certificate revocation status. Default is false.\n Set to true to check peer certificate for revocation." + "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\n on the connection." + "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\u0027s expected name.\n This MUST match the Subject Alternative Name (SAN) or CN on the peer\u0027s (server\u0027s) leaf certificate,\n 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": [ @@ -303,14 +303,14 @@ "Tls12", "Tls13" ], - "description": "Retrieve or set the TLS protocol version.\n The client will let the OS pick a suitable version by using F:System.Security.Authentication.SslProtocols.None .\n If this option is disabled, e.g.see via app context, the client will attempt to fall back\n to TLSv1.2." + "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).\n Defaults to true." + "description": "Set to false to make automatic connection recovery not recover topology (exchanges, queues, bindings, etc).\nDefaults to true." }, "Uri": { "type": "string", @@ -326,7 +326,7 @@ "description": "Virtual host to access during this connection." } }, - "description": "Main entry point to the RabbitMQ .NET AMQP client\n API. Constructs T:RabbitMQ.Client.IConnection instances." + "description": "Main entry point to the RabbitMQ .NET AMQP client\nAPI. Constructs T:RabbitMQ.Client.IConnection instances." }, "ConnectionString": { "type": "string", 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 f33eeeb0d9c..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,13 +15,16 @@ 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() { var root = new JsonObject(); @@ -31,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); } @@ -234,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(); } @@ -325,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) 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/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()); + } +}