Summary
Validate [ConnectorTriggerMetadata], [ConnectorOperation], and related attribute arguments against the SDK index.
Parent: #38 | Depends on: #39 (diagnostics infrastructure)
Diagnostics
Small effort
| Code |
Severity |
Diagnostic |
Detection |
CSDK001 |
Error |
ConnectorName value doesn't match any constant in ConnectorNames class |
Compare attribute string value against SdkIndex.ConnectorNameConstants |
CSDK002 |
Warning |
Possible typo in ConnectorName — did you mean ""X""? |
Levenshtein distance <= 2 against SdkConstant.Value list |
CSDK003 |
Warning |
ConnectorName has wrong casing (e.g., ""Office365"" vs ""office365"") |
Case-insensitive match exists but case-sensitive doesn't |
CSDK004 |
Error |
[ConnectorTriggerMetadata] missing required ConnectorName property |
Check attribute constructor/named args for presence |
CSDK005 |
Error |
[ConnectorTriggerMetadata] missing required OperationName property |
Check attribute constructor/named args for presence |
CSDK006 |
Warning |
[ConnectorTriggerMetadata] applied to non-async method |
Check method signature has async modifier or returns Task/Task<T> |
Medium effort
| Code |
Severity |
Diagnostic |
Detection |
CSDK007 |
Error |
OperationName doesn't exist for connector ""X"" |
Lookup SdkIndex.TriggerOperationsByConnector[connectorName], validate operation exists |
CSDK008 |
Warning |
OperationName specified without ConnectorName — cannot validate |
Detect presence of OperationName but missing ConnectorName |
CSDK009 |
Warning |
[ConnectorOperation] attribute value doesn't match any known operation for this connector |
Cross-reference operation method discovery from SdkDynamicOperationsDiscovery |
Implementation Notes
- Use Roslyn
SemanticModel.GetDeclaredSymbol() to get method symbols, then inspect GetAttributes()
- Extract attribute argument values via
AttributeData.ConstructorArguments and NamedArguments
SdkIndex.ConnectorNameConstants already provides the full list of valid connector names
SdkIndex.TriggerOperationsByConnector maps connector → valid trigger operations
- For typo detection, use simple Levenshtein distance; suggest the closest match if distance <= 2
Acceptance Criteria
Summary
Validate
[ConnectorTriggerMetadata],[ConnectorOperation], and related attribute arguments against the SDK index.Parent: #38 | Depends on: #39 (diagnostics infrastructure)
Diagnostics
Small effort
CSDK001ConnectorNamevalue doesn't match any constant inConnectorNamesclassSdkIndex.ConnectorNameConstantsCSDK002ConnectorName— did you mean ""X""?SdkConstant.ValuelistCSDK003ConnectorNamehas wrong casing (e.g., ""Office365"" vs ""office365"")CSDK004[ConnectorTriggerMetadata]missing requiredConnectorNamepropertyCSDK005[ConnectorTriggerMetadata]missing requiredOperationNamepropertyCSDK006[ConnectorTriggerMetadata]applied to non-async methodasyncmodifier or returnsTask/Task<T>Medium effort
CSDK007OperationNamedoesn't exist for connector ""X""SdkIndex.TriggerOperationsByConnector[connectorName], validate operation existsCSDK008OperationNamespecified withoutConnectorName— cannot validateCSDK009[ConnectorOperation]attribute value doesn't match any known operation for this connectorSdkDynamicOperationsDiscoveryImplementation Notes
SemanticModel.GetDeclaredSymbol()to get method symbols, then inspectGetAttributes()AttributeData.ConstructorArgumentsandNamedArgumentsSdkIndex.ConnectorNameConstantsalready provides the full list of valid connector namesSdkIndex.TriggerOperationsByConnectormaps connector → valid trigger operationsAcceptance Criteria
SdkIndexcovering valid, invalid, and typo scenarios