Validating a model
It is important to prevent failures by validating a model upfront before the model is uploaded to the Azure Digital Twins instance via an API, or via the Azure Digital Twins Explorer tool. Microsoft provides a .NET client-side DTDL parser library to support this process.
There are two ways to use the validator. Since the parser library is available as a NuGet package called Microsoft.Azure.DigitalTwins.Parser
, you can create your own custom parser or make it part of a service that dynamically uploads models to your Azure Digital Twins instance.
Microsoft also provides a command-line parser example as a .NET project. This project can be downloaded from https://docs.microsoft.com/en-us/samples/azure-samples/dtdl-validator/dtdl-validator/.
Download the ZIP file and extract the contents of it to c:\github\DTDL_Validator
. Start Visual Studio, as shown in the following screenshot:
- Open the
DTDLValidator.sln
solution, which can be found in theC:\Github...