Skip to content

Add DataSchema parameter to CloudEvent creation and data setters - #59

Open
duglin with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-dataschema-attribute
Open

duglin with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-dataschema-attribute

Conversation

Copilot AI commented Nov 6, 2026 •

Copy link
Copy Markdown

New-CloudEvent, Set-CloudEventData, and Set-CloudEventJsonData lacked a parameter for setting the CloudEvents dataschema attribute.

  • API: Add optional -DataSchema to all three cmdlets, accepting an absolute URI.
  • Compatibility: Preserve an existing schema when data setters omit the parameter.
  • Coverage and docs: Add regression tests for assignment, preservation, and invalid URIs; document the parameter and usage.
$cloudEvent | Set-CloudEventJsonData `
    -Data @{ 'Foo' = 'Hello' } `
    -DataSchema 'https://example.com/schema.json'

Copilot AI linked an issue Nov 6, 2026 that may be closed by this pull request
@duglin
duglin marked this pull request as ready for review November 6, 2026 23:20
Co-authored-by: duglin <1944671+duglin@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with setting DataSchema attribute for CloudEvent Add DataSchema parameter to CloudEvent creation and data setters Nov 6, 2026
Copilot AI requested a review from duglin November 6, 2026 23:24
@duglin

duglin commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@oising look ok to you?

@duglin

duglin commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@copilot please fix the CI issues

Co-authored-by: duglin <1944671+duglin@users.noreply.github.com>
@oising

oising commented Nov 6, 2026

Copy link
Copy Markdown

@oising look ok to you?

Looking... It seems there is no binding-by-property-name configured on the parameter. I'm looking at the suite as a whole to see if this was ignored en-masse

@oising

oising commented Nov 6, 2026

Copy link
Copy Markdown

@oising look ok to you?

Lgtm

Room for improvement but not in this PR

@duglin

duglin commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

You sure? We could ask copilot to improve it

@oising

oising commented Nov 6, 2026

Copy link
Copy Markdown

You sure? We could ask copilot to improve it

Well okay, hold off until tomorrow and I'll give you some hints for the robot

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] There appears to be no way to set the DataSchema attribute

3 participants