allegro / allegro/allegro-api

[NEWS] Wzbogacamy błędy o użyteczne metadane / Extend errors with useful metadata

Aperta
#9,184 0 commenti 1 reazione 1 assegnatario Rivendicata da @MartaNowaczyk Vedi su GitHub
News
Lingua principale
Nessun dato sulla lingua
Stelle
244
Fork
40
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Podczas tworzenia lub edycji oferty, w żądaniach zakończonych błędem, zwrócimy dodatkowe dane w obiekcie **"errors.metadata"**. W pierwszej kolejności **dla błędów "PARAMETER_MISMATCH" zwrócimy identyfikator produktu**, którego różnica dotyczy.

**Przykładowy response**:

```
{
"errors": [
{
"code": "PARAMETER_MISMATCH",
"message": "The provided parameter 'Wysokość produktu'(223329) value (202.00) does not match the existing parameter value (22.00)",
"details": null,
"path": "productSet[0].product.parameters",
"userMessage": "The specified product exists. The specified parameter `Wysokość produktu` with the value `202.00` does not match the product parameter `22.00`.",
"metadata": {
"productId": "8b6270a8-06c6-4ad7-a9c2-7443a79ea4ab"
}
}
]
}
```

**Dlaczego wprowadziliśmy zmianę?**

Chcemy, by Twoja aplikacja mogła wskazać użytkownikowi dokładną przyczynę błędnego przetworzenia żądania. Dzięki zmianie będziesz mógł w łatwy sposób sięgnąć po dane produktu, którego błąd dotyczy i zaprezentować je sprzedającemu.

—-----

During offer creation, in requests that end with an error, we will return additional data in the **"errors.metadata"** object. First, **in case of "PARAMETER_MISMATCH" errors, we will return a product id** to which the difference applies.

**Example response:**

```
{
"errors": [
{
"code": "PARAMETER_MISMATCH",
"message": "The provided parameter 'Wysokość produktu'(223329) value (202.00) does not match the existing parameter value (22.00)",
"details": null,
"path": "productSet[0].product.parameters",
"userMessage": "The specified product exists. The specified parameter `Wysokość produktu` with the value `202.00` does not match the product parameter `22.00`.",
"metadata": {
"productId": "8b6270a8-06c6-4ad7-a9c2-7443a79ea4ab"
}
}
]
}
```

**Why did we make the change?**

We want your application to be able to indicate to the user the exact reason why the request was processed incorrectly. Thanks to the change, you will be able to easily reach out and present the data of the product affected by the error to the seller.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.