pbandk icon indicating copy to clipboard operation
pbandk copied to clipboard

generate classes with non-null Message types with custom options / extensions

Open Dogacel opened this issue 3 years ago • 0 comments

Refers to

  • #242

Overview

Allow not nullable Message types to be generated by using custom protobuf options or extensions.

  • Added tests to verify stuff are working fine.

How

  • Add a new option called required_field_extension_number.
  • Update CodeGenerator to allow nullable MESSAGE type and set the default value to be the constructor invocation (default instance)

Risks

  • Extension number clashing, I find it unlikely but could be nice to double-check.
  • Circular dependency, I left this one to the user. Circular paths with not nullable messages lead to infinite recursion.

Dogacel avatar Nov 18 '22 23:11 Dogacel