[.NET] Fix the things schema for schema registry#1236
Merged
timtay-microsoft merged 3 commits intomainfrom Feb 19, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the WoT schema naming rules for Schema Registry so generated .NET response types deserialize service error payloads correctly (restoring the pre-WoT behavior where the error field is named error).
Changes:
- Update Schema Registry
SchemaNames.jsonto emit the action response error field name aserror. - Regenerate/update .NET Schema Registry response schemas to use
[JsonPropertyName("error")]and anErrorproperty. - Update the generated Schema Registry client stub logic to read/write the new
Errorproperty.
Reviewed changes
Copilot reviewed 1 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eng/wot/schemaregistry/SchemaNames.json | Changes action response error field naming rule to output error. |
| dotnet/src/Azure.Iot.Operations.Services/SchemaRegistry/Generated/SchemaRegistry.g.cs | Updates generated client logic to set/check Response.Error instead of action-specific error properties. |
| dotnet/src/Azure.Iot.Operations.Services/SchemaRegistry/Generated/PutResponseSchema.g.cs | Renames error field mapping to [JsonPropertyName("error")] with Error property. |
| dotnet/src/Azure.Iot.Operations.Services/SchemaRegistry/Generated/GetResponseSchema.g.cs | Renames error field mapping to [JsonPropertyName("error")] with Error property. |
maximsemenov80
approved these changes
Feb 19, 2026
vaavva
approved these changes
Feb 19, 2026
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.
As seen here before the recent DTDL -> WoT conversion, the behavior of the schema registry generated classes was to define error types like
But recent WoT changes made the same fields get defined like
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.