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

No distinction between explicitly and implicitly assigned enum values in HTML docs. #481

Closed
MisterGC opened this issue Feb 16, 2023 · 2 comments
Labels
doc HTML documentation generator

Comments

@MisterGC
Copy link
Contributor

MisterGC commented Feb 16, 2023

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:

enum uint8 Colors
{
  RED,
  GREEN,
  BLUE
};

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'

@MisterGC MisterGC added the doc HTML documentation generator label Feb 16, 2023
@Mi-La
Copy link
Contributor

Mi-La commented Feb 16, 2023

Duplicate of #468?

@mikir mikir closed this as completed Feb 17, 2023
@MisterGC
Copy link
Contributor Author

yes, sorry - will extend the original issue and add my comments there

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

No branches or pull requests

3 participants