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

Aperta Adatta ai principianti
#690 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 6 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
openapi, python
Ambito
api

Direzione di ricerca

Leggi gli handler in server/app/interfaces/discovery.py intorno alle righe 198–213, poi esamina test_get_unknown_aas_returns_empty e i test POST in server/test/interfaces/test_discovery.py. Aggiorna il comportamento dell’endpoint e le asserzioni in modo che corrispondano alla risposta 404 e alla risposta array specificate; modifica anche test_asset_links_roundtrip in server/test/docker_integration/test_docker_integration_discovery.py. Il lavoro è concluso quando questi test confermano che entrambe le risposte corrispondono alla specifica.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
Python
Stelle
106
Fork
67
Merge medio
3g 18h
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-basyx/basyx-python-sdk

Tutte le issue di eclipse-basyx/basyx-python-sdk

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.