Skip to content

add Counter TM sample#1259

Open
jrdouceur wants to merge 1 commit intomainfrom
johndo/sample-TestThing-Counter
Open

add Counter TM sample#1259
jrdouceur wants to merge 1 commit intomainfrom
johndo/sample-TestThing-Counter

Conversation

@jrdouceur
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new WoT Thing Model (“Counter”) under the engineering test schema samples and checks in the corresponding generated .NET “TestThing” sample artifacts produced by the v2 protocol compiler (codegen2), including schemas, serializer/converter utilities, and generated command/telemetry envoys.

Changes:

  • Introduce Counter.TM.json Thing Model sample for telemetry + RPC actions.
  • Add a new dotnet/samples/Protocol/TestThing sample project containing generated C# client/service code for Counter actions/events.
  • Add generated JSON Schemas for the Counter action inputs/outputs and event collection.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
eng/test/schema-samples/Counter.TM.json New Counter Thing Model sample (actions + event telemetry topics).
dotnet/samples/Protocol/TestThing/TestThing.csproj New .NET sample project to compile the generated Counter types/envoys.
dotnet/samples/Protocol/TestThing/gen.sh Script to regenerate the sample via codegen2 ProtocolCompiler.
dotnet/samples/Protocol/TestThing/schemas/ReadCounterOutputArguments.schema.json Generated JSON schema for readCounter output.
dotnet/samples/Protocol/TestThing/schemas/IncrementInputArguments.schema.json Generated JSON schema for increment input.
dotnet/samples/Protocol/TestThing/schemas/IncrementOutputArguments.schema.json Generated JSON schema for increment output.
dotnet/samples/Protocol/TestThing/schemas/EventCollection.schema.json Generated JSON schema for aggregated event payload.
dotnet/samples/Protocol/TestThing/Utf8JsonSerializer.cs Generated payload serializer used by command/telemetry envoys.
dotnet/samples/Protocol/TestThing/BytesJsonConverter.cs Generated JSON converter utility (base64 bytes).
dotnet/samples/Protocol/TestThing/DateJsonConverter.cs Generated JSON converter utility (DateOnly).
dotnet/samples/Protocol/TestThing/TimeJsonConverter.cs Generated JSON converter utility (TimeOnly).
dotnet/samples/Protocol/TestThing/DurationJsonConverter.cs Generated JSON converter utility (TimeSpan duration).
dotnet/samples/Protocol/TestThing/UuidJsonConverter.cs Generated JSON converter utility (Guid/UUID).
dotnet/samples/Protocol/TestThing/DecimalString.cs Generated decimal-string wrapper type used by serializers.
dotnet/samples/Protocol/TestThing/DecimalJsonConverter.cs Generated converter for DecimalString.
dotnet/samples/Protocol/TestThing/EmptyJson.cs Generated empty payload marker type for no-arg commands.
dotnet/samples/Protocol/TestThing/ValueExtractor.cs Generated helper extensions for nullable extraction.
dotnet/samples/Protocol/TestThing/PropertyTopicAttribute.cs Generated attribute used by property-related codegen patterns.
dotnet/samples/Protocol/TestThing/Counter/Counter.g.cs Generated Counter client/service wrapper aggregating actions + telemetry.
dotnet/samples/Protocol/TestThing/Counter/EventCollection.g.cs Generated event payload type for Counter events.
dotnet/samples/Protocol/TestThing/Counter/EventCollectionSender.g.cs Generated telemetry sender envoy for Counter events.
dotnet/samples/Protocol/TestThing/Counter/EventCollectionReceiver.g.cs Generated telemetry receiver envoy for Counter events.
dotnet/samples/Protocol/TestThing/Counter/ReadCounterOutputArguments.g.cs Generated output arguments model for readCounter.
dotnet/samples/Protocol/TestThing/Counter/ReadCounterActionInvoker.g.cs Generated command invoker envoy for readCounter.
dotnet/samples/Protocol/TestThing/Counter/ReadCounterActionExecutor.g.cs Generated command executor envoy for readCounter.
dotnet/samples/Protocol/TestThing/Counter/IncrementInputArguments.g.cs Generated input arguments model for increment.
dotnet/samples/Protocol/TestThing/Counter/IncrementOutputArguments.g.cs Generated output arguments model for increment.
dotnet/samples/Protocol/TestThing/Counter/IncrementActionInvoker.g.cs Generated command invoker envoy for increment.
dotnet/samples/Protocol/TestThing/Counter/IncrementActionExecutor.g.cs Generated command executor envoy for increment.
dotnet/samples/Protocol/TestThing/Counter/ResetActionInvoker.g.cs Generated command invoker envoy for reset.
dotnet/samples/Protocol/TestThing/Counter/ResetActionExecutor.g.cs Generated command executor envoy for reset.

@timtay-microsoft
Copy link
Member

timtay-microsoft commented Mar 4, 2026

A couple things here:

  • Don't forget to include this csproj as part of the .NET solution. Right now, the csproj isn't being referenced anywhere
  • Feel free to hook up this newly generated counter code to the existing counter client/server samples in that directory since they currently use DTDL codegen output

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.

3 participants