Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-enable variant#inventory_quantity for serialization #801

Closed
axlekb opened this issue Nov 12, 2020 · 3 comments
Closed

Re-enable variant#inventory_quantity for serialization #801

axlekb opened this issue Nov 12, 2020 · 3 comments
Labels
pre-v10 Issue opened prior to release of v10 of library Stale

Comments

@axlekb
Copy link

axlekb commented Nov 12, 2020

First time venturing into inventory... based on the docs it appears variant.inventory_quantity has re-emerged with a different meaning/use after being deprecated and renamed to old_inventory_quantity. Therefore, I believe it should again be "serialized" with current API versions?

image
https://github.com/Shopify/shopify_api/blob/v9.2.0/test/variant_test.rb

 def test_deprecated_inventory_fields_are_included_in_2019_07
    ShopifyAPI::Base.api_version = '2019-07'
    assert @variant.as_json.include?('inventory_quantity')
  end

  def test_deprecated_inventory_fields_are_removed_in_2020_01
    ShopifyAPI::Base.api_version = '2020-01'
    refute @variant.as_json.include?('inventory_quantity')
  end

https://github.com/Shopify/shopify_api/blob/v9.2.0/lib/shopify_api/resources/variant.rb

def serializable_hash(options = {})
      if allow_inventory_params?
        super(options)
      else
        super(options).tap do |resource|
          (resource['variant'] || resource).except!('inventory_quantity', 'old_inventory_quantity')
        end
      end
    end
  def allow_inventory_params?
      Base.api_version < ApiVersion.find_version('2019-10')
    end
@paulomarg
Copy link
Contributor

Hey @axlekb, thank you for reporting this, we'll look into it!

@mkevinosullivan mkevinosullivan added the pre-v10 Issue opened prior to release of v10 of library label Mar 9, 2022
@github-actions
Copy link

github-actions bot commented Oct 8, 2022

This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.

@github-actions github-actions bot added the Stale label Oct 8, 2022
@github-actions
Copy link

We are closing this issue because it has been inactive for a few months.
This probably means that it is not reproducible or it has been fixed in a newer version.
If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.

If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pre-v10 Issue opened prior to release of v10 of library Stale
Projects
None yet
Development

No branches or pull requests

3 participants