Skip to content

@rules endpoint response is not consistent with other endpoints #1901

@davisagli

Description

@davisagli

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions