bigcommerce / bigcommerce-api-ruby

Connect Ruby applications with the Bigcommerce Platform
https://developer.bigcommerce.com
MIT License
79 stars 123 forks source link

updates gem's endpoint to fetch variants along with product #135

Closed charusat09 closed 7 years ago

charusat09 commented 7 years ago

This will enhance GET /products and GET /products/:id endpoints to fetch variants and options in one API call.

jayelkaake commented 7 years ago

Thank you so much for your contribution!!

Do you mind updating the failing tests before we merge?

jayelkaake commented 7 years ago

Do you know if this will slow down the request at all? Product syncs are a big use case and I'd hate to slow down the request for anyone not using variants.

pedelman commented 7 years ago

ping @zvuki @ICarpenter can you help address @jayelkaake's question?

charusat09 commented 7 years ago

@jayelkaake I understand your concern about performance. In that case we can create a separate API endpoint that will help us to fetch product with variants, custom fields and images hence, existing product API will work smoothly. I am open for discussion. Please let me know your thoughts for this.

bookernath commented 7 years ago

@charusat09 I think you're trying to use includes from the V3 API in this PR, but unfortunately this client is intended for use with our V2 API at this time.

For the V3 API our current solution is to allow client auto-generation using swagger - you can plug our V3 API swagger file from here: https://github.com/bigcommerce/api/blob/master/swagger/v3-catalog.yaml

Into here: http://editor.swagger.io/

Which should give you the option to auto-generate a client at the top.

In the future we may look into updating this client or versioning it to support V3.

charusat09 commented 7 years ago

Hey @bookernath currently I am using this same gem for both the versions i.e. v2 and v3. we can upgrade same library to handle both APIs. I can do that. Please share your thoughts on this?

jedgalbraith commented 2 years ago

The swagger spec url in @bookernath's comment seems to have moved. Here's the new url of the swagger V3 Catalog Spec. https://raw.githubusercontent.com/bigcommerce/api-specs/master/reference/catalog.v3.yml