private static void AnalyzeParameter()

in sdk/Sdk.Analyzers/IterableBindingTypeExpectedForBlobContainerPath.cs [52:87]


        private static void AnalyzeParameter(SymbolAnalysisContext context, IParameterSymbol parameter)
        {
            ITypeSymbol parameterType = parameter.Type;

            foreach (AttributeData attribute in parameter.GetAttributes())
            {
                var attributeType = attribute?.AttributeClass;

                if (!IsBlobInputBinding(attributeType))
                {
                    continue;
                }

                foreach (var arg in attribute.ConstructorArguments)
                {
                    if (arg.Type.Name == typeof(string).Name)
                    {
                        string path = arg.Value.ToString();

                        // Skip this analyzer if an expression is used for the blob path
                        if (BlobPathUsesExpression.IsMatch(path))
                        {
                            continue;
                        }

                        if (path.Split('/').Length < 2
                            && !parameterType.IsIterableType(context)
                            && !string.Equals(parameterType.ToDisplayString(), BlobContainerClientType, StringComparison.Ordinal))
                        {
                            var diagnostic = Diagnostic.Create(DiagnosticDescriptors.IterableBindingTypeExpectedForBlobContainer, parameter.Locations.First(), parameterType);
                            context.ReportDiagnostic(diagnostic);
                        }
                    }
                }
            }
        }