Align discovery `GetAllAssetLinksById` and `PostAllAssetLinksById` responses with the specification

Đang mở Phù hợp với người mới
#690 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 6 ngày

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

Đánh giá

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

Hướng nghiên cứu

Đọc các handler trong server/app/interfaces/discovery.py quanh dòng 198–213, sau đó kiểm tra test_get_unknown_aas_returns_empty và các bài kiểm tra POST trong server/test/interfaces/test_discovery.py. Cập nhật hành vi của endpoint và các assertion để khớp với phản hồi 404 và phản hồi mảng được chỉ định; đồng thời điều chỉnh test_asset_links_roundtrip trong server/test/docker_integration/test_docker_integration_discovery.py. Hoàn tất khi các bài kiểm tra này xác nhận cả hai phản hồi đều khớp với đặc tả.

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

Mô tả

bug server

Currently, two endpoints of the Discovery API respond differently from the specification (IDTA-01002 v3.1.1, DiscoveryServiceSpecification/V3.1_SSP-001.yaml):

  1. GET /lookup/shells/{aasIdentifier} responds with 200 and an empty list if no asset links exist for the AAS. The specification
    defines the payload of GetAllAssetLinksById with cardinality 1..* and lists 404 as a response, so the server should respond
    with 404 instead.
  2. POST /lookup/shells/{aasIdentifier} responds with an object that maps the AAS identifier to its asset links, e.g.
    {"<aasId>": [...]}. The OpenAPI file defines the 201 response body of PostAllAssetLinksById as a plain array of
    SpecificAssetId, so the server should return the array only.

See the handlers:

https://github.com/eclipse-basyx/basyx-python-sdk/blob/2c3829d6/server/app/interfaces/discovery.py#L198-L213

The tests currently assert the deviating behavior and need to be adapted:

  • test_get_unknown_aas_returns_empty in server/test/interfaces/test_discovery.py, which already notes that the specification allows 404.
  • The POST tests in AssetLinksByIdEndpointTest, which read the links from body[self.AAS_ID].
  • test_asset_links_roundtrip in server/test/docker_integration/test_docker_integration_discovery.py, which expects 200 and [] from GET after DELETE.
Ngôn ngữ chính
Python
Star
106
Fork
67
Merge trung bình
3 ngày 18 giờ
Pull request đã merge (30 ngày)
3

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-basyx/basyx-python-sdk

Tất cả issue của eclipse-basyx/basyx-python-sdk

Issue tương tự

Thêm issue về Python

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.