exadel-inc / exadel-inc/compreface-javascript-sdk

recognitionService.recognize without limit parameter results in malformed url

Offen
#33 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
105
Forks
42
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Describe the bug**
If you call `recognize` without limit parameter the url is not valid and a 400 is returned from the REST API.

**To Reproduce**
```ts
try {
const result = await recognitionService.recognize(path_toTestImage, {
face_plugins: 'landmarks,gender,age',
det_prob_threshold: 0.95,
status: true
});
} catch (e) {
console.error('Error while recognize' + e.message);
console.error(e.config.url); // <-- comes here. not good
}
```
Prints
`http://localhost:8000/api/v1/recognition/recognize?det_prob_threshold=0.95?face_plugins=landmarks,gender,age?status=true`

**Expected behavior**
If I do not pass limit it should use a default or build a valid url.
Should be
`http://localhost:8000/api/v1/recognition/recognize?det_prob_threshold=0.95&face_plugins=landmarks,gender,age&status=true`

Maybe other webservers/backends do not care but I use the docker-compose version from https://github.com/exadel-inc/CompreFace/releases/tag/v1.0.0

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start at the recognitionService.recognize entry point and trace how its optional parameters are serialized into the request URL. Reproduce the call without limit, then verify that query parameters are joined correctly and the resulting REST request is accepted.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, typescript
Bereich
api
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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