Skip to content

A code sample that uses the DTDL parser library to validate DTDL model code for data description in IoT.

License

Notifications You must be signed in to change notification settings

ridomin/DTDL-Validator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

page_type languages products name description urlFragment
sample
csharp
azure-digital-twins
azure-iot-pnp
DTDL Validator
A code sample for validating DTDL model code
dtdl-validator

Introduction

This project demonstrates use of the Azure Digital Twins DTDL parser, available here on NuGet. It is language-agnostic, and can be used as a command line utility to validate a directory tree of DTDL files. It also provides an interactive mode.

The source code shows examples for how to use the parser library, and can validate model documents to make sure the DTDL is valid.

Getting started

The program is a command line application that can be used in normal or interactive mode.

In normal mode, specify:

  • a file extension (-e, default json)
  • a directory to search (-d, default '.')
  • a recursive option that determines if the file search descends into subdirectories (-r, default true)

Interactive mode is entered with the -i option. Type help for information on interactive commands

What the code demonstrates

  • Basic use of the DTDL parser for validation of DTDL
  • Basic use of the object model to access information about DTDL content (see the interactive module, in particular the list and show/showinfo commands)

Build and test

Build the project and run the application from the command line.

You can also create a self-contained single-file .exe (no other files or installations required):

Run

dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true

in the root folder of the repo.

About

A code sample that uses the DTDL parser library to validate DTDL model code for data description in IoT.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%