Azure / iot-plugandplay-models-tools

Tools to manage the device-models repo
MIT License
13 stars 17 forks source link

Detect external references with complex DTDL constructs #132

Closed rido-min closed 3 years ago

rido-min commented 3 years ago

Detect externals like this to decide if we want to block those or let it through.

{
  "@id": "dtmi:example:Interface1;1",
  "@type": "Interface",
  "extends": [
    "dtmi:example:Interface2;1",
    {
      "@id": "dtmi:example:Interface3;1",
      "@type": "Interface",
      "contents": [
        {
          "@type": "Component",
          "name": "comp1",
          "schema": [ "dtmi:example:Interface4;1" ]
        },
        {
          "@type": "Component",
          "name": "comp2",
          "schema": {
            "@id": "dtmi:example:Interface5;1",
            "@type": "Interface",
            "extends": "dtmi:example:Interface6;1"
          }
        }
      ]
    }
  ],
  "@context": "dtmi:dtdl:context;2"
}
digimaun commented 3 years ago

This is tested and covered in the preview.1 release.