{"record":{"id":"0823e55ba7456db3","repo":"microsoft/aspire","slug":"description","errorCode":null,"errorMessage":"description","messagePattern":"description","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Kubernetes/Annotations/HelmChartDescriptionAnnotation.cs","lineNumber":18,"sourceCode":"// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\nusing Aspire.Hosting.ApplicationModel;\n\nnamespace Aspire.Hosting.Kubernetes;\n\n/// <summary>\n/// An annotation placed on a <see cref=\"KubernetesEnvironmentResource\"/> that specifies\n/// the Helm chart description written to the generated <c>Chart.yaml</c>.\n/// </summary>\n/// <param name=\"description\">A <see cref=\"ReferenceExpression\"/> representing the chart description value.</param>\npublic sealed class HelmChartDescriptionAnnotation(ReferenceExpression description) : IResourceAnnotation\n{\n    /// <summary>\n    /// Gets the Helm chart description as a <see cref=\"ReferenceExpression\"/>.\n    /// </summary>\n    public ReferenceExpression Description { get; } = description ?? throw new ArgumentNullException(nameof(description));\n}\n","sourceCodeStart":1,"sourceCodeEnd":20,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Kubernetes/Annotations/HelmChartDescriptionAnnotation.cs#L1-L20","documentation":"HelmChartDescriptionAnnotation wraps a ReferenceExpression that becomes the Helm chart's description. The primary constructor throws ArgumentNullException when description is null so an annotation with an empty description can never enter the resource model and later break Helm manifest generation.","triggerScenarios":"Constructing HelmChartDescriptionAnnotation directly with a null ReferenceExpression, or calling a WithDescription-style extension that forwards a null expression.","commonSituations":"Developers pass the result of a method that can return null (e.g. a conditional expression or an unassigned ReferenceExpression variable) into the annotation constructor.","solutions":["Pass a valid ReferenceExpression, e.g. ReferenceExpression.Create($\"My chart description\").","Skip adding the annotation when you have no description instead of passing null.","Check the upstream expression-building call for a null return before constructing the annotation."],"exampleFix":"// before\nannotation = new HelmChartDescriptionAnnotation(null);\n\n// after\nannotation = new HelmChartDescriptionAnnotation(ReferenceExpression.Create($\"Payments chart\"));","handlingStrategy":"validation","validationCode":"if (description is null) return; // skip annotation instead of constructing with null","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build descriptions with ReferenceExpression.Create and never assign null to expression variables.","Skip annotation registration when no description is available."],"tags":["kubernetes","helm","null-argument","annotation"],"backgroundTag":"null-argument","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}