Azure / iot-plugandplay-models-tools

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

Validate --strict in expanded form #125

Closed rido-min closed 3 years ago

rido-min commented 3 years ago

dmr-client validate accepts a JSON array (as the parser accepts the array as well).

However EnsureSubDtmiNamespace --strict check should fail though the current implementation won't support an array.

digimaun commented 3 years ago

This is now the behavior using dmr-client/1.0.0-beta.1.

Example

No error validating the expanded (array of models) TemperatureController model. image

Now using --strict, well provide a friendly error.

image

rido-min commented 3 years ago

I was expecting that validating a file with the expanded form will use the interfaces in the array to resolve dependencies.

digimaun commented 3 years ago

That should be the case already. Is there some behavior that leads you to believe its not? When you use a file that contains an array, each array model is extracted separately into the collection which is passed to the parser.

digimaun commented 3 years ago

You can verify this by running dmr-client validate against an exported model, with --debug, and seeing there are no resolution fetches occurring - image