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

Abierto Apto para principiantes
#690 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 6 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
openapi, python
Área
api

Línea de trabajo

Lee los handlers en server/app/interfaces/discovery.py alrededor de las líneas 198–213 y luego inspecciona test_get_unknown_aas_returns_empty y las pruebas POST en server/test/interfaces/test_discovery.py. Actualiza el comportamiento del endpoint y las aserciones para que coincidan con la respuesta 404 y la respuesta de array especificadas; ajusta también test_asset_links_roundtrip en server/test/docker_integration/test_docker_integration_discovery.py. El trabajo estará terminado cuando estas pruebas confirmen que ambas respuestas coinciden con la especificación.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Python
Estrellas
106
Forks
67
Merge medio
3 d 18 h
PR fusionados (30 d)
3

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de eclipse-basyx/basyx-python-sdk

Todos los issues de eclipse-basyx/basyx-python-sdk

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.