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

Document enum descriptions #7

Open
jewzaam opened this issue Feb 11, 2015 · 2 comments
Open

Document enum descriptions #7

jewzaam opened this issue Feb 11, 2015 · 2 comments
Labels

Comments

@jewzaam
Copy link
Member

jewzaam commented Feb 11, 2015

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

@jewzaam
Copy link
Member Author

jewzaam commented Feb 12, 2015

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:

@dcrissman
Copy link
Member

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.

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

No branches or pull requests

2 participants