Skip to content

fix: check required resource fields of a response in Python and .NET - #279

Merged
tconley1428 merged 3 commits into
mainfrom
moe/up/required-resource-result-field-2
Oct 26, 2026
Merged

tconley1428 merged 3 commits into
mainfrom
moe/up/required-resource-result-field-2

Conversation

@moetemp

@moetemp moetemp commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

What changed?

This PR checks a resource's required field in a response before an operation builds the resource. Python raises RuntimeError and .NET throws InvalidOperationException. TypeScript already checks it.

The fix is in the second commit, 6ebfe8bc. The first commit makes the stream-service sample's create-stream return the stream resource, with the output on main.

Why?

A proto response field is always optional. On main, an empty response builds a Stream with no ref, and the Python sample doesn't type-check.

How did you test it?

The Python and .NET goldens show the check in create-stream.

A response field is always optional, so an empty response built a resource without its identity field.
@tconley1428
tconley1428 merged commit a4a8b6d into main Oct 26, 2026
5 checks passed
@tconley1428
tconley1428 deleted the moe/up/required-resource-result-field-2 branch October 26, 2026 16:16
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