Skip to content

When record is nested by a non-record type (e.g. interface) use simple builder name#97

Merged
rbygrave merged 2 commits intomainfrom
feature/nested-not-record
Feb 1, 2026
Merged

When record is nested by a non-record type (e.g. interface) use simple builder name#97
rbygrave merged 2 commits intomainfrom
feature/nested-not-record

Conversation

@rbygrave
Copy link
Contributor

With #67 all records that were nested inside ANY type had a builder name in the form: <enclosedTypeShortName>$<recordShortName>Builder

This change checks the enclosed type and if it is NOT a record type (say an interface) then just use the simple builder name in the form: <recordShortName>Builder

For record types that are nested inside a record type the current behaviour remains and the generated builders get the full unique name that includes the enclosed type short name.

The use case triggering this change is where the records are defined in an interface type (for an http client).

…e builder name

With #67 all records that were nested inside ANY type had a builder name in the form:
<enclosedTypeShortName>$<recordShortName>Builder

This change checks the enclosed type and if it is NOT a record type (say an interface)
then just use the simple builder name in the form:
<recordShortName>Builder

For record types that are nested inside a record type the current behaviour
remains and the generated builders get the full unique name that includes
the enclosed type short name.

The use case triggering this change is where the records are defined in an
interface type (for an http client).
@SentryMan SentryMan added this to the 2.0 milestone Jan 31, 2026
@rbygrave rbygrave enabled auto-merge (squash) February 1, 2026 08:23
@rbygrave rbygrave merged commit 51ff4b7 into main Feb 1, 2026
5 checks passed
@SentryMan SentryMan deleted the feature/nested-not-record branch February 2, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants