From e08829ec6ea53c478fdd0ed5326dbc9cc51c6eb0 Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Thu, 30 Jan 2025 15:11:03 +0100 Subject: [PATCH 01/15] feat: add a @registration-userschema endpoint --- docs/source/endpoints/userschema.md | 19 +++++ news/1873.feature | 2 + .../services/userschema/configure.zcml | 1 + src/plone/restapi/services/userschema/user.py | 31 ++++++++- .../http-examples/registration_userschema.req | 3 + .../registration_userschema.resp | 69 +++++++++++++++++++ src/plone/restapi/tests/test_documentation.py | 5 ++ .../restapi/tests/test_services_userschema.py | 64 ++++++++++++++++- 8 files changed, 190 insertions(+), 4 deletions(-) create mode 100644 news/1873.feature create mode 100644 src/plone/restapi/tests/http-examples/registration_userschema.req create mode 100644 src/plone/restapi/tests/http-examples/registration_userschema.resp diff --git a/docs/source/endpoints/userschema.md b/docs/source/endpoints/userschema.md index a59f582c92..4b15906920 100644 --- a/docs/source/endpoints/userschema.md +++ b/docs/source/endpoints/userschema.md @@ -37,3 +37,22 @@ The server will respond with the user schema. The user schema uses the same serialization as the type's JSON schema. See {ref}`types-schema` for detailed documentation about the available field types. + +## Getting the registration form + +In Plone we can configure each of the fields of the user schema to be available only in the user edit form, in the registration form or in both of them. + +To get the user schema available for the user registration form, make a request to the `/@registration-userschema` endpoint. + +```{eval-rst} +.. http:example:: curl httpie python-requests + :request: ../../../src/plone/restapi/tests/http-examples/registration_userschema.req +``` + +The server will respond with the user schema. + +```{literalinclude} ../../../src/plone/restapi/tests/http-examples/registration_userschema.resp + :language: http +``` + +The user schema uses the same serialization as the type's JSON schema. diff --git a/news/1873.feature b/news/1873.feature new file mode 100644 index 0000000000..e5ddb69202 --- /dev/null +++ b/news/1873.feature @@ -0,0 +1,2 @@ +Add a @registration-userschema endpoint to get the fields for the registration form +[erral] diff --git a/src/plone/restapi/services/userschema/configure.zcml b/src/plone/restapi/services/userschema/configure.zcml index ce25cc016a..30db69e43f 100644 --- a/src/plone/restapi/services/userschema/configure.zcml +++ b/src/plone/restapi/services/userschema/configure.zcml @@ -12,4 +12,5 @@ name="@userschema" /> + diff --git a/src/plone/restapi/services/userschema/user.py b/src/plone/restapi/services/userschema/user.py index 17e201bcca..89688de421 100644 --- a/src/plone/restapi/services/userschema/user.py +++ b/src/plone/restapi/services/userschema/user.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +from plone.app.users.browser.register import getRegisterSchema from plone.app.users.browser.userdatapanel import getUserDataSchema from plone.restapi.serializer.converters import json_compatible from plone.restapi.services import Service @@ -6,11 +7,23 @@ from plone.restapi.types.utils import get_fieldsets from plone.restapi.types.utils import get_jsonschema_properties from plone.restapi.types.utils import iter_fields +from zope.interface import implementer +from zope.publisher.interfaces import IPublishTraverse +@implementer(IPublishTraverse) class UserSchemaGet(Service): - def reply(self): - user_schema = getUserDataSchema() + def __init__(self, context, request): + super().__init__(context, request) + self.params = [] + + def publishTraverse(self, request, name): + # Consume any path segments after /@userschema as parameters + self.params.append(name) + return self + + def build_userschema_as_jsonschema(self, user_schema): + """function to build a jsonschema from user schema information""" fieldsets = get_fieldsets(self.context, self.request, user_schema) # Build JSON schema properties @@ -33,3 +46,17 @@ def reply(self): "required": required, "fieldsets": get_fieldset_infos(fieldsets), } + + def reply(self): + if len(self.params) == 0: + return self.build_userschema_as_jsonschema(getUserDataSchema()) + elif len(self.params) == 1 and self.params[0] == "registration": + return self.build_userschema_as_jsonschema(getRegisterSchema()) + + self.request.response.setStatus(400) + return dict( + error=dict( + type="Invalid parameters", + message="Parameters supplied are not valid.", + ) + ) diff --git a/src/plone/restapi/tests/http-examples/registration_userschema.req b/src/plone/restapi/tests/http-examples/registration_userschema.req new file mode 100644 index 0000000000..2a6eeaa0d8 --- /dev/null +++ b/src/plone/restapi/tests/http-examples/registration_userschema.req @@ -0,0 +1,3 @@ +GET /plone/@userschema/registration HTTP/1.1 +Accept: application/json +Authorization: Basic YWRtaW46c2VjcmV0 diff --git a/src/plone/restapi/tests/http-examples/registration_userschema.resp b/src/plone/restapi/tests/http-examples/registration_userschema.resp new file mode 100644 index 0000000000..17970c2f7a --- /dev/null +++ b/src/plone/restapi/tests/http-examples/registration_userschema.resp @@ -0,0 +1,69 @@ +HTTP/1.1 200 OK +Content-Type: application/json + +{ + "fieldsets": [ + { + "behavior": "plone", + "fields": [ + "fullname", + "email", + "username", + "password", + "password_ctl", + "mail_me" + ], + "id": "default", + "title": "Default" + } + ], + "properties": { + "email": { + "description": "We will use this address if you need to recover your password", + "factory": "Email", + "title": "Email", + "type": "string", + "widget": "email" + }, + "fullname": { + "description": "Enter full name, e.g. John Smith.", + "factory": "Text line (String)", + "title": "Full Name", + "type": "string" + }, + "mail_me": { + "default": false, + "description": "", + "factory": "Yes/No", + "title": "Send a confirmation mail with a link to set the password", + "type": "boolean" + }, + "password": { + "description": "Enter your new password.", + "factory": "Password", + "title": "Password", + "type": "string", + "widget": "password" + }, + "password_ctl": { + "description": "Re-enter the password. Make sure the passwords are identical.", + "factory": "Password", + "title": "Confirm password", + "type": "string", + "widget": "password" + }, + "username": { + "description": "Enter a user name, usually something like 'jsmith'. No spaces or special characters. Usernames and passwords are case sensitive, make sure the caps lock key is not enabled. This is the name used to log in.", + "factory": "Text line (String)", + "title": "User Name", + "type": "string" + } + }, + "required": [ + "email", + "username", + "password", + "password_ctl" + ], + "type": "object" +} diff --git a/src/plone/restapi/tests/test_documentation.py b/src/plone/restapi/tests/test_documentation.py index 5f2c92d97d..6a20fac0cb 100644 --- a/src/plone/restapi/tests/test_documentation.py +++ b/src/plone/restapi/tests/test_documentation.py @@ -2516,6 +2516,11 @@ def test_documentation_schema_user(self): save_request_and_response_for_docs("userschema", response) + def test_documentation_registration_schema_user(self): + response = self.api_session.get("/@userschema/registration") + + save_request_and_response_for_docs("registration_userschema", response) + class TestRules(TestDocumentationBase): layer = PLONE_RESTAPI_DX_FUNCTIONAL_TESTING diff --git a/src/plone/restapi/tests/test_services_userschema.py b/src/plone/restapi/tests/test_services_userschema.py index 5a09bb1e48..327812e1a8 100644 --- a/src/plone/restapi/tests/test_services_userschema.py +++ b/src/plone/restapi/tests/test_services_userschema.py @@ -63,6 +63,38 @@ def test_userschema_get(self): self.assertTrue("object", response["type"]) + def test_registration_userschema_get(self): + response = self.api_session.get("/@userschema/registration") + + self.assertEqual(200, response.status_code) + response = response.json() + + self.assertIn("fullname", response["fieldsets"][0]["fields"]) + self.assertIn("email", response["fieldsets"][0]["fields"]) + self.assertIn("password", response["fieldsets"][0]["fields"]) + self.assertIn("password_ctl", response["fieldsets"][0]["fields"]) + self.assertIn("username", response["fieldsets"][0]["fields"]) + self.assertIn("mail_me", response["fieldsets"][0]["fields"]) + + self.assertIn("fullname", response["properties"]) + self.assertIn("email", response["properties"]) + self.assertIn("password", response["properties"]) + self.assertIn("password_ctl", response["properties"]) + self.assertIn("username", response["properties"]) + self.assertIn("mail_me", response["properties"]) + + self.assertIn("email", response["required"]) + self.assertIn("username", response["required"]) + self.assertIn("password", response["required"]) + self.assertIn("password_ctl", response["required"]) + + self.assertTrue("object", response["type"]) + + def test_userschema_with_invalid_params(self): + response = self.api_session.get("/@userschema/something-invalid") + + self.assertEqual(400, response.status_code) + @unittest.skipIf(not PLONE5, "Just Plone 5 currently.") class TestCustomUserSchema(unittest.TestCase): @@ -133,7 +165,7 @@ def setUp(self): False Age - + False Department @@ -159,7 +191,7 @@ def setUp(self): False Pi - + False Vegetarian @@ -196,3 +228,31 @@ def test_userschema_get(self): self.assertIn("skills", response["fieldsets"][0]["fields"]) self.assertIn("pi", response["fieldsets"][0]["fields"]) self.assertIn("vegetarian", response["fieldsets"][0]["fields"]) + + def test_userschema_for_registration_get(self): + response = self.api_session.get("/@userschema/registration") + + self.assertEqual(200, response.status_code) + response = response.json() + # Default fields + self.assertIn("fullname", response["fieldsets"][0]["fields"]) + self.assertIn("email", response["fieldsets"][0]["fields"]) + self.assertIn("username", response["fieldsets"][0]["fields"]) + self.assertIn("password", response["fieldsets"][0]["fields"]) + self.assertIn("password_ctl", response["fieldsets"][0]["fields"]) + self.assertIn("mail_me", response["fieldsets"][0]["fields"]) + + # added fields + self.assertIn("department", response["fieldsets"][0]["fields"]) + self.assertIn("vegetarian", response["fieldsets"][0]["fields"]) + + # fields not shown in the regisration form + self.assertNotIn("home_page", response["fieldsets"][0]["fields"]) + self.assertNotIn("description", response["fieldsets"][0]["fields"]) + self.assertNotIn("location", response["fieldsets"][0]["fields"]) + self.assertNotIn("portrait", response["fieldsets"][0]["fields"]) + self.assertNotIn("birthdate", response["fieldsets"][0]["fields"]) + self.assertNotIn("another_date", response["fieldsets"][0]["fields"]) + self.assertNotIn("age", response["fieldsets"][0]["fields"]) + self.assertNotIn("skills", response["fieldsets"][0]["fields"]) + self.assertNotIn("pi", response["fieldsets"][0]["fields"]) From 55d67dd40324239ff83f69c73350da5cc4614125 Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 08:14:05 +0100 Subject: [PATCH 02/15] Update docs/source/endpoints/userschema.md Co-authored-by: Steve Piercy --- docs/source/endpoints/userschema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/endpoints/userschema.md b/docs/source/endpoints/userschema.md index 4b15906920..4bca41bac3 100644 --- a/docs/source/endpoints/userschema.md +++ b/docs/source/endpoints/userschema.md @@ -38,7 +38,7 @@ The user schema uses the same serialization as the type's JSON schema. See {ref}`types-schema` for detailed documentation about the available field types. -## Getting the registration form +## Get the registration form In Plone we can configure each of the fields of the user schema to be available only in the user edit form, in the registration form or in both of them. From 72f805b1bb7eb091b1676c0e374d7cff1c7b55c0 Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 08:14:19 +0100 Subject: [PATCH 03/15] Update docs/source/endpoints/userschema.md Co-authored-by: Steve Piercy --- docs/source/endpoints/userschema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/endpoints/userschema.md b/docs/source/endpoints/userschema.md index 4bca41bac3..8a4545c53c 100644 --- a/docs/source/endpoints/userschema.md +++ b/docs/source/endpoints/userschema.md @@ -40,7 +40,7 @@ See {ref}`types-schema` for detailed documentation about the available field typ ## Get the registration form -In Plone we can configure each of the fields of the user schema to be available only in the user edit form, in the registration form or in both of them. +In Plone you can configure each of the fields of the user schema to be available in only one of either the user edit form or registration form, or in both of them. To get the user schema available for the user registration form, make a request to the `/@registration-userschema` endpoint. From 77de997d8b722b8984849f035a809098c0b4fd83 Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 08:14:32 +0100 Subject: [PATCH 04/15] Update docs/source/endpoints/userschema.md Co-authored-by: Steve Piercy --- docs/source/endpoints/userschema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/endpoints/userschema.md b/docs/source/endpoints/userschema.md index 8a4545c53c..4beaa21514 100644 --- a/docs/source/endpoints/userschema.md +++ b/docs/source/endpoints/userschema.md @@ -42,7 +42,7 @@ See {ref}`types-schema` for detailed documentation about the available field typ In Plone you can configure each of the fields of the user schema to be available in only one of either the user edit form or registration form, or in both of them. -To get the user schema available for the user registration form, make a request to the `/@registration-userschema` endpoint. +To get the user schema available for the user registration form, make a request to the `@userschema/registration` endpoint. ```{eval-rst} .. http:example:: curl httpie python-requests From 3fd82fec905a8c4dd2a1e6b26f18e5fdf6cec10b Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 08:14:45 +0100 Subject: [PATCH 05/15] Update news/1873.feature Co-authored-by: Steve Piercy --- news/1873.feature | 1 - 1 file changed, 1 deletion(-) diff --git a/news/1873.feature b/news/1873.feature index e5ddb69202..361f1d0e90 100644 --- a/news/1873.feature +++ b/news/1873.feature @@ -1,2 +1 @@ Add a @registration-userschema endpoint to get the fields for the registration form -[erral] From fcb578cc453a89abd20b99b9dd29928bf794d19e Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 08:15:15 +0100 Subject: [PATCH 06/15] change changlog --- news/1873.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/1873.feature b/news/1873.feature index 361f1d0e90..593267530f 100644 --- a/news/1873.feature +++ b/news/1873.feature @@ -1 +1 @@ -Add a @registration-userschema endpoint to get the fields for the registration form +Add a @userschema/registration endpoint to get the fields for the registration form From af9305530cd2f0668eef2a88fb2f421dd66df3da Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 08:16:04 +0100 Subject: [PATCH 07/15] change changlog --- news/1873.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/1873.feature b/news/1873.feature index 593267530f..adf9da2351 100644 --- a/news/1873.feature +++ b/news/1873.feature @@ -1 +1 @@ -Add a @userschema/registration endpoint to get the fields for the registration form +Add a @userschema/registration endpoint to get the fields for the registration form @erral From e8aabd2cff1672ebc4dab42af727334307f79eab Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 10:47:53 +0100 Subject: [PATCH 08/15] Update news/1873.feature Co-authored-by: Steve Piercy --- news/1873.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/1873.feature b/news/1873.feature index adf9da2351..72a44ba38e 100644 --- a/news/1873.feature +++ b/news/1873.feature @@ -1 +1 @@ -Add a @userschema/registration endpoint to get the fields for the registration form @erral +Add a `@userschema/registration` endpoint to get the fields for the registration form. @erral From 6bd67d3e019eac93dcbe3c17a8428f9bcadb21d0 Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 10:48:02 +0100 Subject: [PATCH 09/15] Update src/plone/restapi/services/userschema/configure.zcml Co-authored-by: Steve Piercy --- src/plone/restapi/services/userschema/configure.zcml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plone/restapi/services/userschema/configure.zcml b/src/plone/restapi/services/userschema/configure.zcml index 30db69e43f..ce25cc016a 100644 --- a/src/plone/restapi/services/userschema/configure.zcml +++ b/src/plone/restapi/services/userschema/configure.zcml @@ -12,5 +12,4 @@ name="@userschema" /> - From 7af1f3eb11040387570ad339549841e3c80eb05d Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 10:48:32 +0100 Subject: [PATCH 10/15] Update src/plone/restapi/tests/test_documentation.py Co-authored-by: Steve Piercy --- src/plone/restapi/tests/test_documentation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plone/restapi/tests/test_documentation.py b/src/plone/restapi/tests/test_documentation.py index 6a20fac0cb..43e606590e 100644 --- a/src/plone/restapi/tests/test_documentation.py +++ b/src/plone/restapi/tests/test_documentation.py @@ -2516,7 +2516,7 @@ def test_documentation_schema_user(self): save_request_and_response_for_docs("userschema", response) - def test_documentation_registration_schema_user(self): + def test_documentation_schema_user_registration(self): response = self.api_session.get("/@userschema/registration") save_request_and_response_for_docs("registration_userschema", response) From a340c5b7434742a6567dfe486a11ed975464cc24 Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 10:49:01 +0100 Subject: [PATCH 11/15] Update src/plone/restapi/tests/test_services_userschema.py Co-authored-by: Steve Piercy --- src/plone/restapi/tests/test_services_userschema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plone/restapi/tests/test_services_userschema.py b/src/plone/restapi/tests/test_services_userschema.py index 327812e1a8..f51fbd41b5 100644 --- a/src/plone/restapi/tests/test_services_userschema.py +++ b/src/plone/restapi/tests/test_services_userschema.py @@ -63,7 +63,7 @@ def test_userschema_get(self): self.assertTrue("object", response["type"]) - def test_registration_userschema_get(self): + def test_userschema_registration_get(self): response = self.api_session.get("/@userschema/registration") self.assertEqual(200, response.status_code) From 6bbf3dc9fbd3f96a742478fea2d568012d0daa4a Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 10:51:04 +0100 Subject: [PATCH 12/15] rename test files --- ...{registration_userschema.req => userschema_registration.req} | 0 ...egistration_userschema.resp => userschema_registration.resp} | 0 src/plone/restapi/tests/test_documentation.py | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename src/plone/restapi/tests/http-examples/{registration_userschema.req => userschema_registration.req} (100%) rename src/plone/restapi/tests/http-examples/{registration_userschema.resp => userschema_registration.resp} (100%) diff --git a/src/plone/restapi/tests/http-examples/registration_userschema.req b/src/plone/restapi/tests/http-examples/userschema_registration.req similarity index 100% rename from src/plone/restapi/tests/http-examples/registration_userschema.req rename to src/plone/restapi/tests/http-examples/userschema_registration.req diff --git a/src/plone/restapi/tests/http-examples/registration_userschema.resp b/src/plone/restapi/tests/http-examples/userschema_registration.resp similarity index 100% rename from src/plone/restapi/tests/http-examples/registration_userschema.resp rename to src/plone/restapi/tests/http-examples/userschema_registration.resp diff --git a/src/plone/restapi/tests/test_documentation.py b/src/plone/restapi/tests/test_documentation.py index 43e606590e..c11c41e0cf 100644 --- a/src/plone/restapi/tests/test_documentation.py +++ b/src/plone/restapi/tests/test_documentation.py @@ -2519,7 +2519,7 @@ def test_documentation_schema_user(self): def test_documentation_schema_user_registration(self): response = self.api_session.get("/@userschema/registration") - save_request_and_response_for_docs("registration_userschema", response) + save_request_and_response_for_docs("userschema_registration", response) class TestRules(TestDocumentationBase): From 69706844d08d024e21710842acbe835525ca7e1f Mon Sep 17 00:00:00 2001 From: Mikel Larreategi Date: Fri, 31 Jan 2025 10:57:21 +0100 Subject: [PATCH 13/15] rename --- docs/source/endpoints/userschema.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/endpoints/userschema.md b/docs/source/endpoints/userschema.md index 4beaa21514..218682fe47 100644 --- a/docs/source/endpoints/userschema.md +++ b/docs/source/endpoints/userschema.md @@ -46,12 +46,12 @@ To get the user schema available for the user registration form, make a request ```{eval-rst} .. http:example:: curl httpie python-requests - :request: ../../../src/plone/restapi/tests/http-examples/registration_userschema.req + :request: ../../../src/plone/restapi/tests/http-examples/userschema_registration.req ``` The server will respond with the user schema. -```{literalinclude} ../../../src/plone/restapi/tests/http-examples/registration_userschema.resp +```{literalinclude} ../../../src/plone/restapi/tests/http-examples/userschema_registration.resp :language: http ``` From befd3266dd1a627a1039cb5427146359eb79c7af Mon Sep 17 00:00:00 2001 From: David Glick Date: Sat, 1 Feb 2025 21:04:54 -0800 Subject: [PATCH 14/15] Remove misleading note about Plone 5 --- docs/source/endpoints/userschema.md | 4 ---- src/plone/restapi/tests/test_services_userschema.py | 10 ---------- 2 files changed, 14 deletions(-) diff --git a/docs/source/endpoints/userschema.md b/docs/source/endpoints/userschema.md index 218682fe47..5f0ede5985 100644 --- a/docs/source/endpoints/userschema.md +++ b/docs/source/endpoints/userschema.md @@ -9,10 +9,6 @@ myst: # User schema -```{note} - This is only available on Plone 5. -``` - Users in Plone have a set of properties defined by a default set of fields such as `fullname`, `email`, `portrait`, and so on. These properties define the site user's profile and the user itself via the Plone UI, or the site managers can add them in a variety of ways including PAS plugins. diff --git a/src/plone/restapi/tests/test_services_userschema.py b/src/plone/restapi/tests/test_services_userschema.py index f51fbd41b5..04257810c0 100644 --- a/src/plone/restapi/tests/test_services_userschema.py +++ b/src/plone/restapi/tests/test_services_userschema.py @@ -12,15 +12,6 @@ import unittest -try: - from Products.CMFPlone.factory import _IMREALLYPLONE5 # noqa -except ImportError: - PLONE5 = False -else: - PLONE5 = True - - -@unittest.skipIf(not PLONE5, "Just Plone 5 currently.") class TestUserSchemaEndpoint(unittest.TestCase): layer = PLONE_RESTAPI_DX_FUNCTIONAL_TESTING @@ -96,7 +87,6 @@ def test_userschema_with_invalid_params(self): self.assertEqual(400, response.status_code) -@unittest.skipIf(not PLONE5, "Just Plone 5 currently.") class TestCustomUserSchema(unittest.TestCase): """test userschema endpoint with a custom defined schema. we have taken the same example as in plone.app.users, thatç From 8e6f9ac7d979564812da8e24d335f3358065e25d Mon Sep 17 00:00:00 2001 From: David Glick Date: Sat, 1 Feb 2025 21:09:41 -0800 Subject: [PATCH 15/15] Clarify profile schema vs registration schema --- docs/source/endpoints/userschema.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/source/endpoints/userschema.md b/docs/source/endpoints/userschema.md index 5f0ede5985..a1e86121cd 100644 --- a/docs/source/endpoints/userschema.md +++ b/docs/source/endpoints/userschema.md @@ -13,18 +13,18 @@ Users in Plone have a set of properties defined by a default set of fields such These properties define the site user's profile and the user itself via the Plone UI, or the site managers can add them in a variety of ways including PAS plugins. These fields are dynamic and customizable by integrators so they do not adhere to a fixed schema interface. -This dynamic schema is exposed by this endpoint in order to build the user's profile form. +This dynamic schema is exposed by this endpoint in order to build the user's profile form and the registration form. -## Getting the user schema +## Get the schema for the user profile -To get the current user schema, make a request to the `/@userschema` endpoint. +To get the current schema for the user profile, make a request to the `/@userschema` endpoint. ```{eval-rst} .. http:example:: curl httpie python-requests :request: ../../../src/plone/restapi/tests/http-examples/userschema.req ``` -The server will respond with the user schema. +The server will respond with the user profile schema. ```{literalinclude} ../../../src/plone/restapi/tests/http-examples/userschema.resp :language: http @@ -36,7 +36,7 @@ See {ref}`types-schema` for detailed documentation about the available field typ ## Get the registration form -In Plone you can configure each of the fields of the user schema to be available in only one of either the user edit form or registration form, or in both of them. +In Plone you can configure each of the fields of the user schema to be available in only one of either the user profile form or registration form, or in both of them. To get the user schema available for the user registration form, make a request to the `@userschema/registration` endpoint. @@ -45,7 +45,7 @@ To get the user schema available for the user registration form, make a request :request: ../../../src/plone/restapi/tests/http-examples/userschema_registration.req ``` -The server will respond with the user schema. +The server will respond with the user schema for registration. ```{literalinclude} ../../../src/plone/restapi/tests/http-examples/userschema_registration.resp :language: http