markvincze / sabledocs

Simple static documentation generator for Protobuf and gRPC contracts.
MIT License
46 stars 12 forks source link

Support optional fields in proto3 syntax #13

Closed hedtke closed 8 months ago

hedtke commented 10 months ago

I haven't tested that with a syntax2 file. Maybe we need a general switch in the Context whether we deal with syntax2 or syntax3. That might also be a good idea, because in syntax3 there are no default values and so we can drop that column from the tables.

markvincze commented 10 months ago

Thanks for the patience on this one. Please give me a bit more time, I'd like to dive into this topic of required/optional differences between proto2 and proto3, and then I'll get back to reviewing these changes.

hedtke commented 8 months ago

Hi @markvincze, any update here?

markvincze commented 8 months ago

@hedtke I started looking into it, but I'll need some more time to investigate what the longer term approach should be. Maybe we can check on the fly if there is any field in the type which has a default value, and if not, then don't render the column. That way we wouldn't have to check the Proto version?

In any case, I'll merge this now and release.