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

Allow array params #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

carvil
Copy link

@carvil carvil commented Oct 22, 2013

This change allows one to setup array params in methods such as find_items_advanced, which would enable using itemFilter as described here.

Here is a concrete example. I want to search for items in a given category, but I only want to see top rated sellers and sellers with a business type of Business. The URL would be (replace app-id with your app id):

http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsAdvanced&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=APP-ID&RESPONSE-DATA-FORMAT=JSON&RESTPAYLOAD=true&categoryId=267&itemFilter(0).name=SellerBusinessType&itemFilter(0).value=Business&itemFilter(1).name=TopRatedSellerOnly&itemFilter(1).value=true

Note itemFilter(0) and itemFilter(1), which indicate an array of values. With the change I've introduced, one can do the following:

response = finder.find_items_advanced({
  categoryId: 267,
  outputSelector: 'SellerInfo',
  itemFilter: [{
    name: 'TopRatedSellerOnly',
    value: 'true'
  },{
    name: 'SellerBusinessType',
    value: 'Business'
  }]
})

What do you think about this?

added test for array values

build_rest_payload shold allow array values in order to allow params
like 'itemFilter'

better naming for variables used in build_rest_payload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant