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

オープン 初心者向け
#690 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
openapi, python
領域
api

調査の方向性

server/app/interfaces/discovery.pyの198~213行付近にあるハンドラーを読み、server/test/interfaces/test_discovery.pyのtest_get_unknown_aas_returns_emptyとPOSTテストを確認してください。エンドポイントの動作とアサーションを更新し、指定された404レスポンスと配列レスポンスに一致させてください。また、server/test/docker_integration/test_docker_integration_discovery.pyのtest_asset_links_roundtripも調整してください。これらのテストで両方のレスポンスが仕様に一致することを確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Python
スター
106
フォーク
67
平均マージ
3日 18時間
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

eclipse-basyx/basyx-python-sdk のほかの issue

eclipse-basyx/basyx-python-sdk の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。