Skip to content

Ruby SDK fails to load when a service matches the root module #17413

Description

@ngyna

Problem

When a generated Ruby SDK has the same name for its root module and a service group (for example, Seed::Seed), runtime references such as Seed::Internal inside the nested service are resolved lexically as Seed::Seed::Internal. Loading the gem then raises NameError even though Seed::Internal exists at the top level.

This affects generated models, clients, HTTP helpers, and runtime templates that refer to root-module constants without a leading ::.

Expected behavior

Generated references to constants rooted at the SDK module should be absolute (for example, ::Seed::Internal) so Ruby does not redirect them through a same-named nested module. Public module and class names should remain unchanged.

Reproduction

Generate a Ruby SDK whose organization/root module is Seed and whose tagged service is also Seed, then require the gem and instantiate the root client. The load currently fails while resolving nested runtime constants.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions