plone.restapi icon indicating copy to clipboard operation
plone.restapi copied to clipboard

`@rules` endpoint response is not consistent with other endpoints

Open davisagli opened this issue 9 months ago • 3 comments

The @rules GET endpoint response is not formatted in a consistent way with other endpoints:

  1. It's missing an @id
  2. The actual data is nested under content-rules which is redundant with the name of the endpoint.
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"
            }
        ]
    }
}

However, fixing it now would be a breaking change.

davisagli avatar Mar 24 '25 16:03 davisagli

Hello.. Can i be assigned to this issue if no one's working on it yet?

irtisamsajin avatar Mar 29 '25 11:03 irtisamsajin

@irtisamsajin no. Please read and follow First-time contributors, especially Things not to do, Contributing to Plone, and Contribute to plone.restapi.

stevepiercy avatar Mar 29 '25 11:03 stevepiercy

I am working on this issue

irtisamsajin avatar Mar 29 '25 11:03 irtisamsajin