Skip to content

Annotate binary-content trigger operations for tooling support #51

@daviburg

Description

@daviburg

Problem

The generated trigger operation constants distinguish between binary-content triggers (e.g., OnNewFileV2) and metadata triggers (e.g., OnNewFilesV2) only through XML doc comments. Binary triggers lack a Payload type annotation while metadata triggers have one:

  • OnNewFileV2: no payload type, sends base64-encoded file bytes in a JSON envelope
  • OnNewFilesV2: annotated with OnedriveforbusinessOnNewFilesTriggerPayload, sends structured metadata

This is insufficient for tooling. The LSP cannot programmatically determine which triggers return binary content vs typed metadata, preventing it from generating the correct deserialization code.

Proposed Solution

  1. Add a TriggerPayloadKind enum: Metadata, BinaryContent
  2. Annotate each trigger constant with an attribute or convention that indicates the payload kind
  3. For binary triggers, the Triggers.Operations dictionary should map to a sentinel type or null (currently binary triggers are excluded from the dictionary entirely, which is an implicit but undocumented convention)
  4. Update the CodefulSdkGenerator to emit these annotations from the swagger trigger definitions

Impact

  • SDK consumers trying to handle binary triggers must manually discover the base64 JSON envelope pattern
  • The LSP cannot auto-generate the JsonDocument inspection code needed for binary payloads
  • The Samples project had to discover this pattern through live E2E testing (Connectors-NET-Samples#15)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions