googleapis / googleapis/google-api-nodejs-client

The `Schema$GoogleCloudMlV1__PredictRequest` type does not match what the API expects

Offen
#1,944 12 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: cloudml external priority: p2 type: bug
Vorherrschende Sprache
TypeScript
Sterne
12.2k
Forks
2k
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
24

Beschreibung

#### Environment details

- OS: Linux
- Node.js version: 10.16.3
- npm version: 6.9.0
- `googleapis` version: 47.0.0

#### Steps to reproduce

1. Use Typescript to call `google.ml('v1').predict()`. The `predict()` expects a property `requestBody` of type `Schema$GoogleCloudMlV1__PredictRequest`.
2. Implementing this involves wrapping the expected payload in string called 'data'
3. The API responses with
```
'Invalid request. The service expects the request to be a valid JSON object with a list-valued attribute called `instances`, i.e. `{"instances": [...]}`. The received request was:\nb\'{"httpBody":{"data":"{\\\\"instances\\\\":[[1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,525,965,5280]]}"}}\'' },
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start with the TypeScript signature for google.ml('v1').predict() and the Schema$GoogleCloudMlV1__PredictRequest type. Compare the request shape produced from requestBody with the API error, which expects a JSON object containing instances. Done means the typed request can send that payload and the API accepts it.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
gcp, nodejs, typescript
Bereich
api, machine-learning
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
32/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.