Auto-generate binary trigger payload handling from SDK annotations

Open
#25 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
csharp
Domain
tooling

Research direction

Start by locating where the LSP processes ConnectorTriggerMetadata and where CodeAction or CodeLens features are registered; no files or tests are named in the issue. Check prerequisite SDK issue #51 first, then define completion as handling binary and metadata payloads and warning about typed deserialization on binary triggers.

Written by the indexing model from the issue text.

Description

enhancement

Problem

When a developer writes a trigger callback function for a binary-content trigger (e.g., OneDrive OnNewFileV2), they must manually write JsonDocument inspection code to detect the body field type and decode base64 content. This boilerplate is error-prone and non-obvious.

The AI Gateway sends binary triggers as JSON with a base64 string body:

  • Binary: {"body":""}
  • Metadata: {"body":{"value":[{...typed items...}]}}

Both arrive with Content-Type: application/json, so content-type sniffing does not work.

Proposed Solution

When the LSP detects a [ConnectorTriggerMetadata] attribute referencing a binary-content trigger operation, it should:

  1. Offer a CodeAction/CodeLens to generate the binary payload handling boilerplate
  2. Generate the JsonDocument body-type inspection pattern
  3. Generate the base64 decode + byte array extraction
  4. Warn if the developer uses a typed TriggerCallbackPayload deserializer on a binary trigger

Prerequisites

This depends on Azure/Connectors-NET-SDK#51 - the SDK needs to annotate trigger operations as binary vs metadata before the LSP can act on them.

Dominant language
C#
Stars
0
Forks
4
Avg merge
3d 2h
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/Connectors-NET-LSP

All issues in Azure/Connectors-NET-LSP

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.