Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Creation of a new target succeeds despite empty name

Offen
#1,237 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
java
Bereich
api

Rechercherichtung

Start at the POST /rest/v1/targets endpoint and trace how target creation handles the name field. Reproduce the request from the issue's shell example; done means an empty name is rejected instead of creating a target named after its controller ID.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

I'm working on a library providing Go bindings for Eclipse Hawkbit. As a part of the process I created integration tests that interrogate a real Hawkbit installation to see how it behaves.

According to the documentation at https://www.eclipse.org/hawkbit/rest-api/targets-api-guide/#_create_list_of_targets the name fields is mandatory when creating a target. Providing an empty value unexpectedly succeeds, with the name being set to the controller ID.

See the sample shell test program I created.

    # We should not be able to create a target with an empty name
    # https://www.eclipse.org/hawkbit/rest-api/targets-api-guide/#_create_list_of_targets
    curl \
        --verbose \
        --dump-header resp.head \
        --output resp.body \
        -H "$TEST_HAWKBIT_AUTH" \
        -H 'Accept: application/hal+json' \
        -H 'Content-Type: application/json;charset=UTF-8' \
        "${TEST_HAWKBIT_URL}/rest/v1/targets" \
        -d '[{"controllerId": "1001", "name": "",  "description": "First test device", "securityToken": "9999", "address": "https://localhost:8001"}]'

    # The request unexpected succeeds.
    fromdos resp.head
    GREP -qFx 'HTTP/1.1 201 Created' < resp.head

    # The returned data is sane.
    jq '.[0].controllerId' -r < resp.body | GREP -qFx 1001
    # The name seems to default to the value of the controllerId.
    jq '.[0].name' -r < resp.body | GREP -qFx "1001"
    jq '.[0].description' -r < resp.body | GREP -qFx "First test device"
    jq '.[0].createdBy' -r < resp.body | GREP -qFx admin
    jq '.[0].lastModifiedBy' -r < resp.body | GREP -qFx admin
    jq '.[0].updateStatus' -r < resp.body | GREP -qFx unknown
    jq '.[0]._links.self.href' -r < resp.body | GREP -qFx "${TEST_HAWKBIT_URL}/rest/v1/targets/1001"
Vorherrschende Sprache
Java
Sterne
601
Forks
228
Ø Merge
15 Std. 58 Min.
Gemergte PRs (30 T.)
62

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus eclipse-hawkbit/hawkbit

Alle Issues in eclipse-hawkbit/hawkbit

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

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