dgs-codegen
dgs-codegen copied to clipboard
Default constructor could be visible when JSpecify is enabled with all nullable fields
When JSpecify is enabled (generateJSpecifyAnnotations = true), object types with all nullable fields (no non-null fields) generates a private default no-arg constructor. It could be made conditionally public based on nullability of fields.
Context:
When generateJSpecifyAnnotations = true, the no-arg constructor is never visible. This is intended so applications begin using the public all-args constructor to benefit from nullability annotations or use builders instead. However, it does not currently check nullability on fields to decide when to hide the default no-arg constructor.