Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Customer.search returns HTTPResponse instead of array of Customer object

Abierto
#1,361 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
ruby
Área
api, backend

Línea de trabajo

Comienza en el punto de entrada ShopifyAPI::Customer.search y sigue cómo se devuelve su respuesta en comparación con las API de otros recursos. Reproduce la consulta mostrada en el issue y verifica que el resultado sea un array de objetos Customer, no un objeto HttpResponse.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Issue summary

Before opening this issue, I have:

  • Upgraded to the latest version of the package
    • shopify_api version: 14.8.0
    • Ruby version: 3.4.1
    • Operating system: OS X
  • Set log_level: :debug in my configuration, if applicable
  • Found a reliable way to reproduce the problem that indicates it's a problem with the package
  • Looked for similar issues in this repository
  • Checked that this isn't an issue with a Shopify API

When calling ShopifyAPI::Customer.search the result is an ShopifyAPI::Clients::HttpResponse object. This is pretty different than other API's, most (all?) of which seem to return resource objects

Expected behavior

Returned value should be an array of Customer Objects

Actual behavior

It's an HTTPResponse Object

Steps to reproduce the problem

Demonstrating a call:

3.4.1 :049 > ShopifyAPI::Customer.search(query: "email:[email protected]")
 =>
#<ShopifyAPI::Clients::HttpResponse:0x000000012c452bd0
 @api_call_limit={request_count: 1, bucket_size: 40},
 @body=
  {"customers" =>
    [{"id" => 7209130524768,
      "email" => "[email protected]",

So as a client I have to do this:

 ShopifyAPI::Customer.search(query: "email:[email protected]").body["customers"].map { ShopifyAPI::Customer.new(from_hash: it) }

Debug logs

// Paste any relevant logs here
Lenguaje dominante
Ruby
Estrellas
1.1k
Forks
484
Merge medio
4 h 38 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Shopify/shopify-api-ruby

Todos los issues de Shopify/shopify-api-ruby

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.