Open jewzaam opened 9 years ago
Quick rundown of how this works.
For an enum you can define values or annotatedValues when creating/updating entityInfo. Metadata should always return the annotatedValues structure, even if there are no descriptions.
The idea here was to not break the service contract (json schema) for metadata but move towards forcing the annotatedValues structure.
@dcrissman did I get this right? I remember talking about this but I think it wasn't written down?
References:
When the enum is being parsed from json, annotatedValues OR values can be used. In the case that both are provided, annotatedValues wins and values is ignored altogether.
When converting an enum back to json however, both will be returned if possible. Meaning, values will always be present, and IF any enum contains a description, then the entire set of enums will also be returned in annotatedValues.
We added support for describing enum values but it doesn't appear to be in documentation.
http://jewzaam.gitbooks.io/lightblue-specifications/content/language_specification/metadata.html