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

Ouverte Adaptée aux débutants
#690 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 6 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
78/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
openapi, python
Domaine
api

Piste de recherche

Lisez les handlers dans server/app/interfaces/discovery.py autour des lignes 198–213, puis examinez test_get_unknown_aas_returns_empty et les tests POST dans server/test/interfaces/test_discovery.py. Mettez à jour le comportement de l’endpoint et les assertions pour qu’ils correspondent à la réponse 404 et à la réponse sous forme de tableau spécifiées ; ajustez également test_asset_links_roundtrip dans server/test/docker_integration/test_docker_integration_discovery.py. Le travail est terminé lorsque ces tests confirment que les deux réponses sont conformes à la spécification.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
Python
Étoiles
106
Forks
67
Merge moyen
3 j 18 h
PR mergées (30 j)
3

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de eclipse-basyx/basyx-python-sdk

Toutes les issues de eclipse-basyx/basyx-python-sdk

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.