Are plone.api
and plone.restapi
related?
I'm trying to understand some plone interna by reading the sources of plone.api
and plone.restapi
and it seems that both libraries have diverging code.
Are plone.api
and plone.restapi
related?
I'm trying to understand some plone interna by reading the sources of plone.api
and plone.restapi
and it seems that both libraries have diverging code.
plone.api is developer friendly access to Plone internal APIs. Something that will only be used in python code.
plone.restapi is exposing, via JSON network calls, various Plone resources (including content). Basically it's publishing all Plone content as "api endpoints". It makes Plone a headless CMS.
My question is aiming at the relations of the internal code of both libraries. Not how to use them.
If we look at how the two of the libraries actually (e.g. create content) the code is very diffent in both libraries:
I have nothing against having different ways to do the same or similar things. I simply assumed that plone.restapi
would access or at least kind of "reuse" the or some funtions of plone.api
.
In contrast to all other core packages, plone.restapi
could use plone.api
and also depends on it for tests.
But in fact it does not use it:
https://github.com/plone/plone.restapi/search?q=plone.api
Edit:
Our dependency tree does not allow core packages to depend on plone.api
to not have a dependency indirection. But plone.restapi
and probably plone.volto
could depend on it. Ongoing untangling of our dependency forest could result in more packages to be added to this could-list.
But plone.api
is meant for addon-usage, not for core. So I would suggest to keep it so.