-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create reusable schemas for complex types #105
Comments
Thanks for bringing up this issue. Currently, DTDL v2 supports reusable types within an interface definition (by using the However, this does not support "globally" reusable types or types defined outside of any interface, which is what you may be asking for. This is a feature we are interested in providing. We're not quite ready to share a design proposal on this, so I will leave this issue open until we get a proposal together to share. |
Theoretically, the schemas are reusable, but actually they are not. When I tried to use it with Azure Digital Twins, my models cannot be uploaded because it says that the Enum Schema is defined in another interface. So they propose to copy the schema in every interface that needs it. This is not useful like that, it is necessary to allow the creation of global schemas that could be reused by all the interfaces or schemas available to the descendants.
|
Any update on this? |
Wow, this is an old thread! I'm sorry to report that DTDL v3, which was released earlier this year, does not include this feature. It is a fairly straightforward addition to the language, but it requires extensive service changes to support storing, indexing, and retrieving definitions that are not Interfaces, which breaks a lot of assumptions throughout service code. This is recognized as an important use case, but it unfortunately did not make the cut relative to other service features that were in demand. |
I would like to define only once an enum or an object and reuse it as a type.
Example
And then have an interface that uses the enum:
Example:
The text was updated successfully, but these errors were encountered: