[Rust][Services] Update services codegen to use WoT#1229
Draft
[Rust][Services] Update services codegen to use WoT#1229
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Rust services code generation to use the new WoT (Web of Things) Thing Model-based codegen (v1.0.0.0) instead of the DTDL-based codegen (v0.10.0.0). The changes regenerate all service client code and adapt the Schema Registry client to handle enum-to-const conversions and field renames introduced by the new code generator.
Changes:
- Updates code generation script to use codegen2 with WoT Thing Models
- Regenerates Schema Registry, ADR Base Service, and Device Discovery Service client code
- Converts enums to constants/strings (Format, SchemaRegistryErrorCode, SchemaRegistryErrorTarget)
- Adapts Schema Registry client code with TryFrom implementations for type conversions
- Updates field names (e.g.,
error→put_error/get_error) and hardcodes topic patterns
Reviewed changes
Copilot reviewed 194 out of 194 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/azure_iot_operations_services/gen.sh | Updates generation script to use codegen2 with WoT Thing Models and new CLI arguments |
| rust/azure_iot_operations_services/src/schema_registry.rs | Adds TryFrom implementations to convert from generated i32/String types to wrapper enums with validation |
| rust/azure_iot_operations_services/src/schema_registry/client.rs | Updates error handling to use new TryFrom conversions and renamed error fields |
| rust/azure_iot_operations_services/src/schema_registry/schemaregistry_gen/**/*.rs | Regenerated code: enums → const, version bump, field renames, documentation updates |
| rust/azure_iot_operations_services/src/azure_device_registry/adr_base_gen/**/*.rs | Regenerated code: removes MODEL_ID constants, hardcodes topics, enums lose serde renames |
| rust/azure_iot_operations_services/src/azure_device_registry/device_discovery_gen/**/*.rs | Regenerated code: similar patterns to adr_base_gen with enum and topic changes |
...ot_operations_services/src/schema_registry/schemaregistry_gen/schema_registry/schema_type.rs
Show resolved
Hide resolved
...t_operations_services/src/azure_device_registry/adr_base_gen/adr_base_service/code_schema.rs
Show resolved
Hide resolved
vaavva
commented
Feb 18, 2026
...tions_services/src/schema_registry/schemaregistry_gen/schema_registry/get_response_schema.rs
Outdated
Show resolved
Hide resolved
vaavva
commented
Feb 18, 2026
...tions_services/src/schema_registry/schemaregistry_gen/schema_registry/put_response_schema.rs
Outdated
Show resolved
Hide resolved
jrdouceur
reviewed
Feb 19, 2026
timtay-microsoft
added a commit
that referenced
this pull request
Feb 19, 2026
As seen [here](https://github.com/Azure/iot-operations-sdks/blob/8833ca95b26bbed007a5f9112b78a48b224d1270/dotnet/src/Azure.Iot.Operations.Services/SchemaRegistry/SchemaRegistry/GetResponseSchema.g.cs#L20) before the recent DTDL -> WoT conversion, the behavior of the schema registry generated classes was to define error types like ```csharp [JsonPropertyName("error")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] public SchemaRegistryError? Error { get; set; } = default; ``` But recent WoT changes made the same fields get defined like ```csharp [JsonPropertyName("getError")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] public SchemaRegistryError? GetError { get; set; } = default; ``` which would break deserialization of errors sent from the schema registry service. This change alters the SchemaNames.json file such that running code gen gives the expected output on fields like the above. Then codegen was run on this branch. See also #1229 for this same SchemaNames.json file change since it is needed in Rust as well. --------- Co-authored-by: timtay-microsoft <timtay-microsoft@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
serde_json. However, the information provided in the error message conveys similar information even though it is on a different field and not an exact match.