plone.restapi
plone.restapi copied to clipboard
Add @userschema endpoint for getting the user schema.
Related to #706
@sneridagh thanks for creating this Pull Request and help improve Plone!
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.
Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:
@jenkins-plone-org please run jobs
With this simple comment all the jobs will be started automatically.
Happy hacking!
@jenkins-plone-org please run jobs
This is the initial work for adding support to get the schema of zc3.forms (#480), that's why the directory is just called schema, for later add the forms support. I will draft the documentation first for such endpoint.
@jenkins-plone-org please run jobs
Talked about the @schema endpoint with @tisto, agreed on leave it in the fridge for now, since if we have to define the form in the backend is the same effort than we directly customize it in the frontend. Then still, we will have to define the widget mapping (and overrides for specific forms, if any) somehow. So the pros of having it might be very little.
@jenkins-plone-org please run jobs
We need this @userschema endpoint in a project, we can work on updating this PR, at least to have the endpoint working.
@erral awesome!
@jenkins-plone-org please run jobs
We have checked the endpoint and it works as expected, it returns the correct jsonschema for the user profile schema.
I have rebased the branch and run black.
@jenkins-plone-org please run jobs
@jenkins-plone-org please run jobs
@jenkins-plone-org please run jobs
@jenkins-plone-org please run jobs
@jenkins-plone-org please run jobs
@nileshgulia1 but this error is related to the @users endpoint and not to @userschema right? I am adding a test with different field types and the user schema information is rendered correctly. Perhaps what we need is a more complete @users endpoint test that checks all possible field types. Right now it only tests basic stuff.
I have checked it and indeed the user serializer does not take into account datetime objects: https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/serializer/user.py#L50
@erral Indeed, its with @users endpoint. Apart from date_time, some of the existing member fields like "portrait" currently does not work well with volto.
The other fields work well, I think we can merge it then and take care of other tasks/bugs in subsequent PRs.
And there is no deserializer of users, the property set is done manually without deserializing the user: https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/services/users/update.py#L104
The other fields work well, I think we can merge it then and take care of other tasks/bugs in subsequent PRs.
Yes I do agree. I have some changes and tests for the @users endpoint, and we can discuss it further there.
@jenkins-plone-org please run jobs
LGTM!
@tisto could you please take a look? Since I opened it I cannot approve it :)
Then we could merge https://github.com/plone/volto/pull/2917 and release it on 15
Deploy Preview for plone-restapi ready!
| Name | Link |
|---|---|
| Latest commit | 540346790e462c96c6afe475c124ef5f2a0cc58f |
| Latest deploy log | https://app.netlify.com/sites/plone-restapi/deploys/6333faaca5a9b40009df2591 |
| Deploy Preview | https://deploy-preview-707--plone-restapi.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
@jenkins-plone-org please run jobs
Ok, another attempt to merge this one. @tisto I think all is good enough to have this one in. Could you please take a look? Since I opened it I cannot approve it :)
Then we could merge https://github.com/plone/volto/pull/2917
@stevepiercy the Netlify build is red? Could you please take a look?
@stevepiercy uh I got what happened. I didn't know that we move to md in here! Solved!
@jenkins-plone-org please run jobs