Comments (5)
Right now we use "member" from hydra:
{
"@context": "http://www.w3.org/ns/hydra/context.jsonld",
"@id": "http://localhost:55001/plone",
"@type": "Collection",
"member": [
{
"@id": "http://localhost:55001/plone/robot-test-folder",
"description": "",
"title": "Test Folder"
},
{
"@id": "http://localhost:55001/plone/front-page",
"description": "Congratulations! You have successfully installed Plone.",
"title": "Welcome to Plone"
}
],
"parent": {},
"portal_type": "SiteRoot"
}```
from plone.restapi.
@tisto is this decision still current?
I'm seeing some different approaches being used in the various docs, for example in searching.rst
it's @items
, and there's some collection+json
examples as well.
I don't have any strong feelings towards either style, but it's something that probably needs to be agreed upon quite soon. Also, it's not like we can't ever change it again. For now, I'd like to resolve some contradictions in style in the current docs, and then start implementing things using whatever style is documented.
from plone.restapi.
This issue is more meant to be a documentation of the current state than a final decision. @lrowe @bloodbare and me discussed this issue during PLOG, we did not reach a final conclusion though.
I tend to keep the hydra "member" and add a "parent" attribute, just because I don't see strong arguments for a certain option. I'm more than open for suggetions or a discussion...
from plone.restapi.
The only issue I see with member
and parent
is the name collisions you already pointed out in your first comment. We simply can't control what people name their fields, or what fields are named in an addon product they might be using. And the choices available to us in case of a collision aren't pretty:
- Fail hard, and have certain objects not be retrievable via API
- Overwrite the existing attribute in the output and introduce a rather subtle bug
- Have the attribute override our
member
attribute and omit collection members
Maybe we could handle collisions using one of these strategies:
- Automatically resolve name conflicts using a conflict resolution algorithm that makes the attribute name unique, and rename that attribute
- Or: Put a mechanism in place that allows integrators / developers to rename particular fields for serialization by providing a name mapping. Then fail hard in case of a conflict, and display a helpful message indicating that the conflict needs to be resolved by providing such a mapping for field
x
.
Either of these mechanisms would need to be applied on output as well as input though.
from plone.restapi.
+2 for __parent__
and __children__
The terms are my favorite because the words distinct the relation better than 'items' or 'container' e.g. do, and the underscores should be a pretty safe bet, concerning possible collisions.
from plone.restapi.
Related Issues (20)
- relatedItems field returns None in the serializer if the related item is deleted HOT 1
- Site Administrator cannot add user to group
- Add remote_url(getRemoteUrl) to link content-types in navigation HOT 4
- Include release notes in Plone 6 Documentation
- Authentication error messages from PAS Plugins aren't returned by the restapi HOT 1
- restapi double parameter is broking code. HOT 8
- In content that uses the plone.blocks behavior, it is not possible to add fields to SearchableText with "plone.app.dexterity.textindexer" HOT 6
- Community Forum App Icon Not Filling Correctly. HOT 1
- Add plone.app.discussion control panel
- Types control panel does not allow to enable/disable discussion for a content type
- Implement SummaryDiscussionListingTemplate to fix Discussion url in listings HOT 1
- Documentation of event content type does not return a timezone
- NoneType' object has no attribute 'getProperty': when searching users HOT 1
- @querystring shouldn't list userids
- Test with Plone 6.1 HOT 1
- Require plone.app.iterate on test extras
- Require plone.app.upgrade in test extras
- @aliases endpoint should allow to filter by how an alias has been added (automatically, manually)
- @aliases endpoint should support filtering by date (from, to) HOT 3
- @aliases endpoint should allow to upload/download all aliases and allow to download filtered aliases as CSV file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plone.restapi.