Shopify / Shopify/shopify-api-ruby

API objects return nil when dereferenced with non-existing method

Open
#1,272 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.1k
Forks
484
PR merge metrics
No merged PRs in 30d

Description

Issue summary

When I call a method on a ShopifyAPI api object that doesn't exist it returns nil instead of raising NoMethodError

  • shopify_api version: 13.4
  • Ruby version:
  • Operating system:

Expected behavior

An exception should be raised NoMethodError

Actual behavior

The method call returns nil

Steps to reproduce the problem

  1. Instantiate a ShopifyAPI ruby object (I used an api product)
  2. Dereference with a non-existent method

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by reproducing the non-existent-method call on a ShopifyAPI object with Ruby, then locate the API object's method-dispatch entry point; done means the call raises NoMethodError rather than returning nil, with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.