Azure / opendigitaltwins-dtdl

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

Can't create Azure PnP code stub if interface schema contains an array. #42

Closed SteveMaz closed 4 years ago

SteveMaz commented 4 years ago

Issue Type: Bug

Create an interface schema that contains the array sample shown below.

{ "@type": "Telemetry", "name": "ledState", "schema": { "@type": "Array", "elementSchema": "boolean" } }

Try to build the code stub for this. The following error is displayed:

[ERROR][PnPCodeGen] Failed to parse interface definition, @id: urn:................:.....................:1, error: Microsoft.Azure.IoT.DigitalTwin.Parser.ModelParserException: Content is not valid

Name=ledState:elementSchema, Id=Name, Description=Name is required Name=ledState:elementSchema, Description=Schema should be provided

[IoT Plug and Play] generate PnP device code failed.

The same interface schema can be uploaded to Azure successfully.

VS Code version: Code 1.40.2 (f359dd6, 2019-11-25T14:54:45.096Z) OS version: Windows_NT x64 10.0.18362

dooriya commented 4 years ago

@SteveMaz Thanks for the feedback.

Currently we don't support the Array schema in CodeGen tool, so this is a feature requirement. If you feel that this feature is crucial, we are happy to listen and to reconsider to put it in our road-map.