Skip to content

Handle omitted data content type in Set-CloudEventData - #62

Merged
duglin merged 2 commits into
mainfrom
copilot/fix-cloud-event-data-bugs
Nov 11, 2026
Merged

duglin merged 2 commits into
mainfrom
copilot/fix-cloud-event-data-bugs

Conversation

Copilot AI commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Set-CloudEventData threw when -DataContentType was omitted and discarded the ContentType object it created.

  • Content type handling: Create and assign a ContentType only when -DataContentType is supplied; otherwise leave the event’s existing content type unchanged.
  • Regression coverage: Cover omitted content type and explicit ContentType assignment.
$cloudEvent | Set-CloudEventData -Data 'payload'

Copilot AI linked an issue Nov 11, 2026 that may be closed by this pull request
@duglin
duglin marked this pull request as ready for review November 11, 2026 12:21
Co-authored-by: duglin <1944671+duglin@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Set-CloudEventData bugs for ContentType handling Handle omitted data content type in Set-CloudEventData Nov 11, 2026
Copilot AI requested a review from duglin November 11, 2026 12:23
@duglin

duglin commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

/cc @oising for review

@oising

oising commented Nov 11, 2026

Copy link
Copy Markdown

/cc @oising for review

LGTM

@duglin
duglin merged commit f3dbde9 into main Nov 11, 2026
9 checks passed
@duglin
duglin deleted the copilot/fix-cloud-event-data-bugs branch November 11, 2026 15:39
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.

[BUG] Fix a few bugs

3 participants