Skip to content

[WIP] Fix DataContent mapping to embedded resources#1378

Closed
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-datacontent-mapping
Closed

[WIP] Fix DataContent mapping to embedded resources#1378
Copilot wants to merge 1 commit into
mainfrom
copilot/fix-datacontent-mapping

Conversation

Copilot AI commented Feb 24, 2026

Copy link
Copy Markdown
Contributor
  • Understand the current code: DataContent catch-all at line 412 always creates BlobResourceContents for embedded resources, even when the MIME type is text-based
  • Add a new case in the ToContentBlock switch expression: when DataContent has a top-level media type of "text", map it to EmbeddedResourceBlock with TextResourceContents instead of BlobResourceContents
  • Update existing tests that assume text MIME types round-trip as BlobResourceContents
  • Add a new test for text MIME type DataContent → TextResourceContents round-trip
  • Build and run tests to verify the fix
  • Code review and security scan

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants