Azure / opendigitaltwins-dtdl

Digital Twins Definition Language
Creative Commons Attribution 4.0 International
470 stars 160 forks source link

It's valid an interface without contents? #64

Closed rido-min closed 4 years ago

rido-min commented 4 years ago

Given

{
    "@context": "dtmi:dtdl:context;2",
    "@id": "dtmi:com:m1;1",
    "@type": "Interface"
}

The parser reports it as valid

model size = 1
id=dtmi:com:m1;1 type=DTInterfaceInfo
JSON-LD text:
{
  "@context": [
    "dtmi:dtdl:context;2"
  ],
  "@id": "dtmi:com:m1;1",
  "@type": "Interface"
}
    property=IsPartition type=Boolean value=True (Boolean)
    property=EntityKind type=DTEntityKind value=Interface (DTEntityKind)
    property=Id type=Dtmi value=dtmi:com:m1;1 (Dtmi)
    property=LanguageVersion type=Int32 value=2 (Int32)
    property=IsPartition type=Boolean value=True (Boolean)

But uploading to the model repository fails

image

/c @briancr-ms

briancr-ms commented 4 years ago

Yes, it's valid to have an interface definition without a contents property. This is described in the DTDL v2 language spec where the property contents is listed as optional: https://github.com/Azure/opendigitaltwins-dtdl/blob/master/DTDL/v2/dtdlv2.md#interface.