From bfaca98e575dc14a7204fb32be23f5249ad4f942 Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Thu, 11 Jun 2026 17:36:38 +0100 Subject: [PATCH] Fix admin API user endpoint documentation examples to use JSON booleans (#19847) I noticed that the documentation doesn't match reality. The values from the database are cast to bools at: - https://github.com/element-hq/synapse/blob/ff034c1f623bc769f1f3bca801592dd42697ea66/synapse/storage/databases/main/registration.py#L424-L439 - https://github.com/element-hq/synapse/blob/ff034c1f623bc769f1f3bca801592dd42697ea66/synapse/storage/databases/main/__init__.py#L330-L344 --- changelog.d/19847.doc | 1 + docs/admin_api/user_admin_api.md | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 changelog.d/19847.doc diff --git a/changelog.d/19847.doc b/changelog.d/19847.doc new file mode 100644 index 0000000000..225b03d7b3 --- /dev/null +++ b/changelog.d/19847.doc @@ -0,0 +1 @@ +Fixed the Admin API user endpoint documentation examples to use JSON booleans (true/false) instead of numeric (0/1) values. diff --git a/docs/admin_api/user_admin_api.md b/docs/admin_api/user_admin_api.md index 14f86fa976..9e2b756208 100644 --- a/docs/admin_api/user_admin_api.md +++ b/docs/admin_api/user_admin_api.md @@ -34,11 +34,11 @@ It returns a JSON body like the following: } ], "avatar_url": "", // can be null if not set - "is_guest": 0, - "admin": 0, - "deactivated": 0, + "is_guest": false, + "admin": false, + "deactivated": false, "erased": false, - "shadow_banned": 0, + "shadow_banned": false, "creation_ts": 1560432506, "last_seen_ts": 1732919539393, "appservice_id": null, @@ -183,24 +183,24 @@ A response body like the following is returned: "users": [ { "name": "", - "is_guest": 0, - "admin": 0, + "is_guest": false, + "admin": false, "user_type": null, - "deactivated": 0, + "deactivated": false, "erased": false, - "shadow_banned": 0, + "shadow_banned": false, "displayname": "", "avatar_url": null, "creation_ts": 1560432668000, "locked": false }, { "name": "", - "is_guest": 0, - "admin": 1, + "is_guest": false, + "admin": true, "user_type": null, - "deactivated": 0, + "deactivated": false, "erased": false, - "shadow_banned": 0, + "shadow_banned": false, "displayname": "", "avatar_url": "", "creation_ts": 1561550621000,