From fbae1ca2d485ab7f17d5ed6ce3ab1a8efe10f102 Mon Sep 17 00:00:00 2001 From: Mikko Nieminen Date: Thu, 23 Jan 2025 15:07:56 +0100 Subject: [PATCH] update rest api user fields (#1553) --- CHANGELOG.rst | 12 ++++++++ docs/source/app_filesfolders_api_rest.rst | 12 +++++++- docs/source/app_sodarcache_api_rest.rst | 13 ++++++-- docs/source/app_timeline_api_rest.rst | 10 +++++++ docs/source/major_changes.rst | 26 ++++++++++++++-- filesfolders/serializers.py | 17 ++++++----- filesfolders/tests/test_views_api.py | 36 +++++++++++------------ filesfolders/views_api.py | 4 +-- sodarcache/serializers.py | 9 +++--- sodarcache/tests/test_views_api.py | 2 +- sodarcache/views_api.py | 6 +++- timeline/serializers.py | 5 ++-- timeline/tests/test_views_api.py | 8 ++--- timeline/views_api.py | 10 +++++-- 14 files changed, 122 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4b44e97d..901af9f3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -42,6 +42,10 @@ Changed - Replace ``awesome-slugify`` dependency with ``python-slugify`` (#1531, #1547) - Use ``SODARAPI*`` API view base classes instead of ``CoreAPI*`` (#1401) - Declare app setting definitions as ``PluginAppSettingDef`` objects (#1456) +- **Filesfolders** + - Upgrade filesfolders REST API version to 2.0 (#1553) + - Remove compability with filesfolders REST API <2.0 (#1553) + - Replace REST API ``SODARUserSerializer`` fields with UUID ``SlugRelatedField`` (#1553) - **Projectroles** - Deprecate ``get_user_display_name()``, use ``SODARUser.get_display_name()`` (#1487) - Deprecate declaring app setting definitions as dict (#1456) @@ -52,6 +56,14 @@ Changed - Move app setting form helpers in ``SODARAppSettingFormMixin`` (#1545) - Upgrade projectroles REST API version to v1.1 (#836) - Allow empty ``old_owner_role`` in ``RoleAssignmentOwnerTransferAPIView`` (#836) +- **Sodarcache** + - Upgrade sodarcache REST API version to 2.0 (#1553) + - Remove compability with sodarcache REST API <2.0 (#1553) + - Replace REST API ``SODARUserSerializer`` fields with UUID ``SlugRelatedField`` (#1553) +- **Timeline** + - Upgrade timeline REST API version to 2.0 (#1553) + - Remove compability with timeline REST API <2.0 (#1553) + - Replace REST API ``SODARUserSerializer`` fields with UUID ``SlugRelatedField`` (#1553) - **Tokens** - Update UI for site read-only mode (#24) - **Userprofile** diff --git a/docs/source/app_filesfolders_api_rest.rst b/docs/source/app_filesfolders_api_rest.rst index fef852cb..f035cd80 100644 --- a/docs/source/app_filesfolders_api_rest.rst +++ b/docs/source/app_filesfolders_api_rest.rst @@ -42,4 +42,14 @@ Filesfolders REST API Views .. autoclass:: HyperLinkListCreateAPIView -.. autoclass:: HyperLinkRetrieveUpdateDestroyAPIView \ No newline at end of file +.. autoclass:: HyperLinkRetrieveUpdateDestroyAPIView + + +Filesfolders REST API Version Changes +===================================== + +v2.0 +---- + +- All views + * Return ``owner`` as UUID instead of ``SODARUserSerializer`` dict diff --git a/docs/source/app_sodarcache_api_rest.rst b/docs/source/app_sodarcache_api_rest.rst index 74ecd4a6..886d0758 100644 --- a/docs/source/app_sodarcache_api_rest.rst +++ b/docs/source/app_sodarcache_api_rest.rst @@ -14,9 +14,9 @@ Sodarcache REST API Versioning Media Type ``application/vnd.bihealth.sodar-core.sodarcache+json`` Current Version - ``1.0`` + ``2.0`` Accepted Versions - ``1.0`` + ``2.0`` Header Example ``Accept: application/vnd.bihealth.sodar-core.sodarcache+json; version=x.y`` @@ -32,3 +32,12 @@ Sodarcache REST API Views .. autoclass:: CacheItemSetAPIView + +Sodarcache REST API Version Changes +=================================== + +v2.0 +---- + +- ``CacheItemRetrieveAPIView`` + * Return ``user`` as UUID instead of ``SODARUserSerializer`` dict diff --git a/docs/source/app_timeline_api_rest.rst b/docs/source/app_timeline_api_rest.rst index 322adf4c..f78a8c99 100644 --- a/docs/source/app_timeline_api_rest.rst +++ b/docs/source/app_timeline_api_rest.rst @@ -31,3 +31,13 @@ Timeline REST API Views .. autoclass:: SiteTimelineEventListAPIView .. autoclass:: TimelineEventRetrieveAPIView + + +Timeline REST API Version Changes +================================= + +v2.0 +---- + +- ``TimelineEventRetrieveAPIView`` + * Return ``user`` as UUID instead of ``SODARUserSerializer`` dict diff --git a/docs/source/major_changes.rst b/docs/source/major_changes.rst index 1989cbda..b5012a6a 100644 --- a/docs/source/major_changes.rst +++ b/docs/source/major_changes.rst @@ -24,8 +24,14 @@ Release Highlights - Add app setting definition as objects - Update owner transfer form to allow setting no role for old owner - Update app settings API +- Upgrade filesfolders REST API version to v2.0 - Upgrade projectroles REST API version to v1.1 -- Remove support for features deprecated in v1.0 +- Upgrade sodarcache REST API version to v2.0 +- Upgrade timeline REST API version to v2.0 +- Remove support for filesfolders REST API