Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.56k stars 4.82k forks source link

[BUG] Azure Digital Twin C# SDK and Instance allow duplicate telemetry fields a model definition, but ModelParser does not #23443

Closed billy-brown closed 7 months ago

billy-brown commented 3 years ago

Describe the bug Creating an Azure Digital Twin model with DTDL that contains duplicate telemetry fields (same type, same name, same schema) is accepted by the C# SDK and by the ADT Instance, but the ModelParser throws a ParsingException when parsing that same DTDL (retrieved from the ADT Instance).

Expected behavior The C# SDK and the ADT Instance should both raise an error if the DTDL is invalid, in line with what the ModelParser does.

Actual behavior (include Exception or Stack Trace) The C# SDK and the ADT Instance accept the invalid DTDL and create a model with two identically-named telemetry fields.

The ModelParser throws a ParsingException with the following Errors message:

dtmi:test:duplicate:Telemetry;1's property 'contents' contains more than one element whose property 'name' has value 'duplicateField'. Change the value of property 'name' to a string value that is unique across all values of 'contents'.

To Reproduce GitHub gist that reproduces the issue

Environment:

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @drwill-ms, @timtay-microsoft, @abhipsaMisra, @vinagesh, @azabbasi, @barustum, @jamdavi.

Issue Details
**Describe the bug** Creating an Azure Digital Twin model with DTDL that contains duplicate telemetry fields (same type, same name, same schema) is accepted by the C# SDK and by the ADT Instance, but the `ModelParser` throws a `ParsingException` when parsing that same DTDL (retrieved from the ADT Instance). **Expected behavior** The C# SDK and the ADT Instance should both raise an error if the DTDL is invalid, in line with what the `ModelParser` does. **Actual behavior (include Exception or Stack Trace)** The C# SDK and the ADT Instance accept the invalid DTDL and create a model with two identically-named telemetry fields. The `ModelParser` throws a `ParsingException` with the following `Errors` message: ``` dtmi:test:duplicate:Telemetry;1's property 'contents' contains more than one element whose property 'name' has value 'duplicateField'. Change the value of property 'name' to a string value that is unique across all values of 'contents'. ``` **To Reproduce** [GitHub gist that reproduces the issue](https://gist.github.com/billy-brown/0879bb889edaf59397c45c7d73dbbda3) **Environment:** - Azure.DigitalTwins.Core version 1.2.2 Microsoft.Azure.DigitalTwins.Parser version 3.12.7 (see [gist above](https://gist.github.com/billy-brown/0879bb889edaf59397c45c7d73dbbda3) for `.csproj`) - ``` .NET SDK (reflecting any global.json): Version: 5.0.302 Commit: c005824e35 Runtime Environment: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.302\ Host (useful for support): Version: 5.0.8 Commit: 35964c9215 .NET SDKs installed: 5.0.302 [C:\Program Files\dotnet\sdk] ``` - gVim and `dotnet` CLI
Author: billy-brown
Assignees: -
Labels: `Service Attention`, `Client`, `needs-triage`, `customer-reported`, `question`, `needs-team-attention`, `Digital Twins`
Milestone: -
johngallardo commented 3 years ago

Thank you for reporting this issue. This is indeed a service side issue. We are looking to address this in a future service release but do not at this time have an ETA. To avoid a possible breaking change the improved service side validation will be opt-in.

johngallardo commented 2 years ago

@abhinav-ghai assigning this to you.

github-actions[bot] commented 8 months ago

Hi @billy-brown, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.

github-actions[bot] commented 7 months ago

Hi @billy-brown, we deeply appreciate your input into this project. Regrettably, this issue has remained inactive for over 2 years, leading us to the decision to close it. We've implemented this policy to maintain the relevance of our issue queue and facilitate easier navigation for new contributors. If you still believe this topic requires attention, please feel free to create a new issue, referencing this one. Thank you for your understanding and ongoing support.