Azure / opendigitaltwins-dtdl

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

Twin with property using duration schema can not be updated. #114

Open Lushkin opened 3 years ago

Lushkin commented 3 years ago

I try to update a twin which contains a property using a duration schema. A have created an "Asset" model (based on opendigitaltwins-building Ontology models) via the Azure Digital Twins Explorer.

As you can see here I have a TestAsset with almost all values filled except these which uses the duration schema. image

Then I have tried to update the twin with the "expectedLife" value as following: P1Y for 1 year duration. But it never works. I always get an error: image

I have also tried to update the twin via the C# SDK, but I have the same issue.

{"error":{"code":"ValidationFailed","message":"Invalid twin specified","details":[{"code":"ValidationFailed","message":"Validation failed for expectedLife on Twin."}]}}

Am I using a wrong format for my duration value ? I have reported to the documentation which explains that the used format should be ISO 8601. image

So I have followed this documentation to build my duration value. But nothing seems to working.

I have tried the following values to update my twin:

danhellem commented 3 years ago

Hello @Lushkin, we have a bug with duration that is on our list to fix in the next parser update. I don't have an exact date on when that will be available but I will update this thread when we do. Most likely sometime this late spring or early summer.

maxstefaniv commented 3 years ago

just leaving this commemt to have a message when this gets solved. Ty Microsoft Team DT look amazing and very promising :) HOpe to see soon more features.

kartben commented 2 years ago
  • P1Y0M0W0D

For the record, this one is not a valid ISO-8601 duration, as weeks (W) should not appear together with any other units.