Skip to content
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

Clarify versioning rules around enums #35

Open
jspaith opened this issue Sep 27, 2019 · 2 comments
Open

Clarify versioning rules around enums #35

jspaith opened this issue Sep 27, 2019 · 2 comments

Comments

@jspaith
Copy link
Collaborator

jspaith commented Sep 27, 2019

My understanding is that once I define (e.g.) Enum Color {Red, Blue, Green} and publish the interface, then I can NEVER add a Yellow object.

This also flows from https://github.com/Azure/IoTPlugandPlay/tree/master/DTDL#enum describing the enumValues as immutable.

I think it would still be very useful in https://github.com/Azure/IoTPlugandPlay/tree/master/DTDL#enum and anywhere else discussing enums to explicitly call out this behavior. This probably makes sense for a modeling language that has versions, but devs coming from a language like C where enums can always be expanded need to be aware of DTDL behavior.

@jspaith
Copy link
Collaborator Author

jspaith commented Sep 30, 2019

Also same question around adding new fields in an Object. And probably more generally.

I'd recommend adding actually a spec that walks through examples of what is and isn't allowed, in addition to expanding out samples a bit with rules in doc. Thanks.

@briancr-ms
Copy link
Member

Thanks for the feedback! I agree with the need for more examples and details on versioning. A separate doc with more descriptions and examples is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants