Git Product home page Git Product logo

dtdl-validator's Introduction

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

Status note on 6/9/23: This project is being archived in favor of the examples in the DTDL parser repository, which are more recently maintained.

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, no default value)
  • a recursive option that determines if the file search descends into subdirectories (-r, default false)

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.

Package as Global Tool

Run

dotnet publish
dotnet tool install --global --add-source ./DTDLValidator/nupkg DTDLValidator

This appends the path of the generated executible to your system's PATH variable. Now, run dtdl-validator <ARGS> to use the tool.

dtdl-validator's People

Contributors

baanders avatar ridomin avatar jjaramillo98 avatar microsoftopensource avatar joebeernink avatar microsoft-github-operations[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.