Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Creation of a new target succeeds despite empty name

Đang mở
#1,237 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
api

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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"
Ngôn ngữ chính
Java
Star
601
Fork
228
Merge trung bình
18 giờ 20 phút
Pull request đã merge (30 ngày)
58

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-hawkbit/hawkbit

Tất cả issue của eclipse-hawkbit/hawkbit

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.