Skip to content

Conversation

irtisamsajin
Copy link

@irtisamsajin irtisamsajin commented Apr 7, 2025

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/

@mister-roboto
Copy link

@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!

@irtisamsajin
Copy link
Author

@jenkins-plone-org please run jobs

@irtisamsajin
Copy link
Author

@davisagli Can you review this

@davisagli
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@rules endpoint response is not consistent with other endpoints
3 participants