From 1810043b43fde3b7f12b7e62862adff9931152fc Mon Sep 17 00:00:00 2001 From: Christian Monch Date: Wed, 28 Jan 2026 13:48:21 +0100 Subject: [PATCH 1/3] add class-information to the `/server`-endpoint This commit adds information about the classes that are supported by a collection to the result of the /server-endpoint. Note: the class list will not necessarilly list all classes that are defined in the schema, it will contain only those classes, for which storage and retrieval endpoints exists. --- dump_things_service/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dump_things_service/main.py b/dump_things_service/main.py index 0cd93e6..8de67f0 100644 --- a/dump_things_service/main.py +++ b/dump_things_service/main.py @@ -101,6 +101,7 @@ class TokenCapabilityRequest(BaseModel): class ServerCollectionResponse(BaseModel): name: str schema: str + classes: list[str] class ServerCollectionCountedResponse(ServerCollectionResponse): @@ -416,6 +417,7 @@ async def server() -> ServerResponse: ServerCollectionResponse( name=collection_name, schema=g_instance_config.schemas[collection_name], + classes=g_instance_config.model_info[collection_name][1], ) for collection_name in g_instance_config.collections ] -- 2.52.0 From 116c45e3a04535e9c962aa7c4dd2e6f8ad4f7931 Mon Sep 17 00:00:00 2001 From: Christian Monch Date: Wed, 28 Jan 2026 13:54:21 +0100 Subject: [PATCH 2/3] update CHANGELOG.md --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e829bb..f49d771 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# 5.x.x (2026-01-28) + +## New features + +- The `/server`-endpoint result now contains the name of classes that are + supported by the collections, i.e., classes for which storage- and + validation-endpoints exist. + + # 5.3.6 (2026-01-13) ## Changes -- 2.52.0 From 450b1f6ddbfa0389e91a5d583d0821118583bdd9 Mon Sep 17 00:00:00 2001 From: Christian Monch Date: Wed, 28 Jan 2026 21:35:59 +0100 Subject: [PATCH 3/3] update /server-tests --- dump_things_service/tests/test_basic.py | 62 +++++++++++-------------- 1 file changed, 26 insertions(+), 36 deletions(-) diff --git a/dump_things_service/tests/test_basic.py b/dump_things_service/tests/test_basic.py index 4edb46c..fbf87cb 100644 --- a/dump_things_service/tests/test_basic.py +++ b/dump_things_service/tests/test_basic.py @@ -392,50 +392,40 @@ def test_server(fastapi_client_simple): response = test_client.get( '/server', ) + test_schema_classes = [ + 'Thing', + 'Agent', + 'InstantaneousEvent', + 'Person', + ] + flat_social_classes = [ + 'Thing', + 'Property', + 'ValueSpecification', + 'FlatThing', + 'FlatProperty', + 'AnnotationTag', + 'Organization', + 'Person', + 'Project', + ] assert response.status_code == HTTP_200_OK assert response.json() == { 'version': __version__, 'collections': [ { - 'name': 'collection_1', + 'name': f'collection_{i}', 'schema': str(schema_file), - }, + 'classes': test_schema_classes, + } + for i in range(1, 9) + ] + [ { - 'name': 'collection_2', - 'schema': str(schema_file), - }, - { - 'name': 'collection_3', - 'schema': str(schema_file), - }, - { - 'name': 'collection_4', - 'schema': str(schema_file), - }, - { - 'name': 'collection_5', - 'schema': str(schema_file), - }, - { - 'name': 'collection_6', - 'schema': str(schema_file), - }, - { - 'name': 'collection_7', - 'schema': str(schema_file), - }, - { - 'name': 'collection_8', - 'schema': str(schema_file), - }, - { - 'name': 'collection_dlflatsocial-1', + 'name': f'collection_dlflatsocial-{i}', 'schema': 'https://concepts.datalad.org/s/flat-social/unreleased.yaml', - }, - { - 'name': 'collection_dlflatsocial-2', - 'schema': 'https://concepts.datalad.org/s/flat-social/unreleased.yaml', - }, + 'classes': flat_social_classes, + } + for i in range(1, 3) ], } -- 2.52.0