-
Notifications
You must be signed in to change notification settings - Fork 27
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
No difference between explicit and implicit (auto-) values of enum members #468
Comments
Hide auto-generated enum/bitmask values together with comments.
All not defined enumeration values are shown greyed now and are hideable by clicking hiding documentation icon. |
Can you please exclude the values completely (see my motivation above)? |
OK. We will reopen it. |
Is it ok that the only chance to find out the "implicit" values will be to generate code? The values might be useful e.g. for debugging? |
yes, imo it is - one extension could be an option to activate the values in the docs would be possible (false by default), but even then I would clearly indicate that they have not been assigned explicitly. |
For debugging purposes people should use the debug string, which anyhow renders the symbolic name of the enum and not the underlying value. |
zserio generated HTML docs contain enum values also for auto-generated/implicitly assigned enum values. This is misleading and can be confusing when talking about the enum values, because it creates the impression that schema authors have explicitly decided to assign value. But exactly the opposite is the case, schema authors use this feature with "I don't care about the actual value, but assume that zserio keeps it stable as long as the position of the element doesn't change" in mind.
Example:
Generate the HTML docu and the result will contain
RED = 0, GREEN = 1 and BLUE = 2
as if the author did that explicitly.Suggestion: Omit these values in this case, the author intended that users should not care about the actual value when studying the schema.
In case there are users who really need the value the explicit assignment could be commented `// = 1, assigned implicitly'
The text was updated successfully, but these errors were encountered: