plone / plone/plone.restapi

What is the create parameter meant for in DeserializeFromJson.__call__?

Open
#847 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

05 type: question 33 needs: docs
Dominant language
Python
Stars
109
Forks
107
Avg merge
2d 3h
Merged PRs (30d)
4

Description

At ...
https://github.com/plone/plone.restapi/blob/4dff305bb39cc5fb61af9bfbd98b7428b44e398a/src/plone/restapi/deserializer/dxcontent.py#L38-L40

... a create parameter is given without any documentation. The IDeserializeFromJson also defines nothing here. In fact, when create=True is passed nothing is "created" (which in fact would be difficult, because the adapted content is expected to be the target object above while validating) and deserialization is stripped down to validation only, no content is set. except layout and ordering.

Overall this is really confusing and does not make any sense at all.

cc @tisto

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/plone/restapi/deserializer/dxcontent.py at lines 38-40 and inspect the IDeserializeFromJson definition referenced in the issue. Trace the create=True path to confirm its validation-only behavior and determine the intended semantics before deciding whether the parameter needs documentation or clarification. Done means the parameter's purpose and effects are unambiguous.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.