Adds @id to @content-rules endpoint and makes it consistent with other endpoints
Fixes #1901 I have added the @id field to the response. Also made changes to the response so that the response is now consistent with other endpoints
Old response
HTTP/1.1 200 OK
Content-Type: application/json
{
"content-rules": {
"acquired_rules": [],
"assignable_rules": [],
"assigned_rules": [
{
"bubbles": true,
"description": "First rule added in the testing setup",
"enabled": true,
"global_enabled": true,
"id": "rule-1",
"title": "First test rule",
"trigger": "Comment added",
"url": "http://localhost:55001/plone/++rule++rule-1/@@manage-elements"
},
{
"bubbles": true,
"description": "Second rule added in the testing setup",
"enabled": true,
"global_enabled": true,
"id": "rule-2",
"title": "Second test rule",
"trigger": "Comment added",
"url": "http://localhost:55001/plone/++rule++rule-2/@@manage-elements"
}
]
}
}
New Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"@id": "http://localhost:55001/plone/@content-rules",
"acquired_rules": [],
"assignable_rules": [],
"assigned_rules": [
{
"bubbles": true,
"description": "First rule added in the testing setup",
"enabled": true,
"global_enabled": true,
"id": "rule-1",
"title": "First test rule",
"trigger": "Comment added",
"url": "http://localhost:55001/plone/++rule++rule-1/@@manage-elements"
},
{
"bubbles": true,
"description": "Second rule added in the testing setup",
"enabled": true,
"global_enabled": true,
"id": "rule-2",
"title": "Second test rule",
"trigger": "Comment added",
"url": "http://localhost:55001/plone/++rule++rule-2/@@manage-elements"
}
]
}
📚 Documentation preview 📚: https://plonerestapi--1905.org.readthedocs.build/
@irtisamsajin thanks for creating this Pull Request and helping to improve Plone!
TL;DR: Finish pushing changes, pass all other checks, then paste a comment:
@jenkins-plone-org please run jobs
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.
Happy hacking!
@jenkins-plone-org please run jobs
@davisagli Can you review this
@irtisamsajin I will consider this in the future when we are ready to make a release with breaking changes. It is not something that we can include in plone.restapi 9. The issue was a reminder for work in the future, not something that should happen now.