Skip to content

Ruby codegen emits invalid has_edge : (empty edge name) for 5 ad objects #232

Description

@crespire

Description

The Ruby SDK codegen produces has_edge : with an empty edge name for 5 ad object classes. This is not a valid Ruby symbol literal and causes a SyntaxError at load time.

The Python codegen handles these same objects correctly, emitting named methods (genget/gendelete) with endpoint='/'.

Affected classes

Ruby file Invalid output Python SDK equivalent
ad_objects/ad_campaign_group.rb has_edge : do |edge| def genget(self, fields=..., params=...)
ad_objects/ad_campaign_placement.rb has_edge : do |edge| def genget(self, fields=..., params=...)
ad_objects/adgroup.rb has_edge : do |edge| def gendelete(self, fields=..., params=...)
ad_objects/product_catalog_apps_and_software_item.rb has_edge : do |edge| def gendelete(self, fields=..., params=...)
ad_objects/product_catalog_media_title.rb has_edge : do |edge| def gendelete(self, fields=..., params=...)

Expected behavior

The codegen should emit a named edge, e.g.:

has_edge :genget do |edge|
  edge.get 'AdCampaignGroupGet' do |api|
    api.has_param :fields, 'string'
  end
end

Actual behavior

has_edge : do |edge|
  edge.get 'AdCampaignGroupGet' do |api|
    api.has_param :fields, 'string'
  end
end

This raises SyntaxError: unexpected ':', expecting end-of-input when the file is loaded.

Impact

Currently low — these files are autoloaded and nothing references them, so the error is silent. However, this becomes a blocker for any consumer that needs to eager-load the gem (e.g., for thread-safety in Rails/Sidekiq environments) or for consumers that end up needing to use these edges.

Introduced in

Commit ff8f28dc ("Auto-generated ruby SDK code update", D95913002). These files have never had valid edge names.

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