Skip to content

fix(dotnet): keep a resource property apart from its class name - #272

Merged
tconley1428 merged 2 commits into
mainfrom
moe/up/dotnet-resource-property-name-2
Oct 23, 2026
Merged

tconley1428 merged 2 commits into
mainfrom
moe/up/dotnet-resource-property-name-2

Conversation

@moetemp

@moetemp moetemp commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

This PR adds Value to a .NET resource property that has the name of its class, such as StreamValue on Stream.

The fix is in the second commit, 545138a6. The first commit generates the stream-service sample for .NET with the output on main, where Stream has a Stream property.

Why?

C# refuses a member with the name of its class (CS0542).

How did you test it?

The .NET golden shows StreamValue. A sample test round-trips a Stream through the payload converter.

@moetemp
moetemp requested a review from a team as a code owner October 23, 2026 04:04
@moetemp
moetemp force-pushed the moe/up/dotnet-resource-property-name-2 branch from bad8742 to 5750cd4 Compare October 23, 2026 04:35
@moetemp
moetemp force-pushed the moe/up/resource-method-record-result branch from 095326a to e3a5c38 Compare October 23, 2026 04:35
@moetemp
moetemp force-pushed the moe/up/dotnet-resource-property-name-2 branch from 5750cd4 to 6758b6d Compare October 23, 2026 08:46
@moetemp
moetemp changed the base branch from moe/up/resource-method-record-result to main October 23, 2026 08:46
@moetemp
moetemp force-pushed the moe/up/dotnet-resource-property-name-2 branch from 6758b6d to c74a58d Compare October 23, 2026 08:54
@moetemp
moetemp changed the base branch from main to moe/up/stream-service-sample October 23, 2026 08:54
@moetemp
moetemp force-pushed the moe/up/stream-service-sample branch from 39d2f20 to c4f0743 Compare October 23, 2026 18:51
@moetemp
moetemp force-pushed the moe/up/dotnet-resource-property-name-2 branch 2 times, most recently from a6a9e7f to e681d1b Compare October 23, 2026 18:55
moetemp added a commit that referenced this pull request Oct 23, 2026
)

## What changed?

This PR adds a `stream-service` sample for Python and TypeScript, with today's output. #272 adds .NET with its fix. It has a `stream` resource built from a ref, `create-stream`, append, read, describe and close, with 64-bit offsets, payloads and durations.

Its records are proto-backed, as a stream service's are. Upstream has no stream protos, so the sample has its own small proto in `descriptors/streamsample/v1/`, with checked-in bindings. The samples README has the commands that regenerate them. `build_examples` now loads every `*.bin` under `descriptors/`.

## Why?

Later fixes show their effect as a golden diff on this sample.

## How did you test it?

The goldens. A TypeScript test sends a full `ReadRecordsRequest` through the converter, so the TypeScript type file can't drift from the proto.

## What comes next

These fixes are ready, in this order. Each one adds its shape to this sample, then the fix.

- #272: adds .NET, where the `stream` field of the `Stream` class fails with CS0542, then the fix.
- [moetemp#52](moetemp#52): Check required resource fields of a response. Adds `create-stream` returning the `stream` resource.
- [moetemp#56](moetemp#56): Allow a result record to hold a resource. Adds a `create-stream-result` holder record.
- [moetemp#53](moetemp#53): Emit `@nexus.doc` on resources and methods as Python docstrings.
- [moetemp#70](moetemp#70): Convert 64-bit resource method values to `Long` for a proto request in TypeScript. Adds 64-bit method parameters. Needs #265.
- [moetemp#54](moetemp#54): Generate a Python caller per service over a transport. Turns on the client for the sample.
- [moetemp#55](moetemp#55): Add `@nexus.long-poll` to the Python caller. Marks `read-records` as a long poll.
- [moetemp#57](moetemp#57): Add Python client classes for resources with methods.
- [moetemp#71](moetemp#71): Drop the bare keyword marker from a Python signature with no parameters. Adds a `stream-writer` interface with no endpoint.
- [moetemp#60](moetemp#60): Indent the docstrings of Python caller methods. Adds a doc on a writer operation.
- [moetemp#69](moetemp#69): Import record types that an endpoint-less Python client uses in unpacked parameters. Adds `open-writer`.
- [moetemp#72](moetemp#72): Plan proto unsigned integers as unsigned. Adds a `uint64` writer id.
- [moetemp#73](moetemp#73): Build a returned proto-wire resource in an endpoint-less TypeScript client. Makes `open-writer` return the `writer` resource.

#262 adds a `status` enum to the holder record once it merges.
Base automatically changed from moe/up/stream-service-sample to main October 23, 2026 19:02
@moetemp
moetemp force-pushed the moe/up/dotnet-resource-property-name-2 branch from e681d1b to 545138a Compare October 23, 2026 19:03
@tconley1428
tconley1428 merged commit 84d41e2 into main Oct 23, 2026
5 checks passed
@tconley1428
tconley1428 deleted the moe/up/dotnet-resource-property-name-2 branch October 23, 2026 19:51
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