Skip to content

Commit

Permalink
Update SupportsDeferredBinding diagnostic code & update docs (#1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
liliankasem committed Jul 17, 2023
1 parent 4e8b57a commit 94bb624
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions docs/analyzer-rules/AZFW0009.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# AZFW0009: Invalid use of SupportsDeferredBinding attribute

| | Value |
|-|-|
| **Rule ID** |AZFW0009|
| **Category** |[Usage]|
| **Severity** |Error|

## Cause

This rule is triggered when the `SupportsDeferredBinding` attribute is used on any class other
than an input (`InputBindingAttribute`) or trigger (`TriggerBindingAttribute`) binding based class.

## Rule description

The `SupportsDeferredBinding` attribute is used to determine if a binding supports deferred binding.
Currently, this feature is only supported for input and trigger bindings. Output bindings are not supported
and this attribute should not be used on any other class type.

## How to fix violations

Remove the use of the `SupportsDeferredBinding` attribute from your class.

## When to suppress warnings

This rule should not be suppressed because this error may prevent your Azure Functions from running.
2 changes: 1 addition & 1 deletion sdk/Sdk.Analyzers/DiagnosticDescriptors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private static DiagnosticDescriptor Create(string id, string title,string messag
category: Constants.DiagnosticsCategories.Usage, severity: DiagnosticSeverity.Error);

public static DiagnosticDescriptor DeferredBindingAttributeNotSupported{ get; }
= Create(id: "AZFW0003", title: "Invalid class attribute", messageFormat: "The attribute '{0}' can only be used on trigger and input binding attributes.",
= Create(id: "AZFW0009", title: "Invalid class attribute", messageFormat: "The attribute '{0}' can only be used on trigger and input binding attributes.",
category: Constants.DiagnosticsCategories.Usage, severity: DiagnosticSeverity.Error);

}
Expand Down

0 comments on commit 94bb624

Please sign in to comment.