diff --git a/ftmstore_fastapi/views.py b/ftmstore_fastapi/views.py index 3c92b4a..b538036 100644 --- a/ftmstore_fastapi/views.py +++ b/ftmstore_fastapi/views.py @@ -99,7 +99,7 @@ async def entity_list( adjacents = [] entities = [e async for e in view.get_entities(query, retrieve_params)] if retrieve_params.nested: - adjacents = await view.get_adjacents(entities) + adjacents = await view.get_adjacents(entities, inverted=False) return EntitiesResponse.from_view( request=request, entities=entities, diff --git a/tests/test_api.py b/tests/test_api.py index 3ae3a44..a68f521 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -98,6 +98,11 @@ def test_api_dataset_entities(): data = res.json() assert data["total"] == 0 + res = client.get("/entities?dataset=ec_meetings&schema=Event&limit=1&nested=true") + assert res.status_code == 200 + data = res.json() + assert data["entities"][0]["properties"]["organizer"][0]["schema"] == "PublicBody" + def test_api_dataset_entity_detail(): res = client.get("/entities/addr-00177d9455d8e1b6a3f5530ea1e7e81ce1c8333f")