Rest v2 API POST search entity view param is not honored

As per documentation at
Cuba 6.9 Rest docs
I should be able to pass a view when using entity search post method.

But the same is not working and I am getting minimal view with just instance name fields.

Sample payload which is not working:

{
            "filter": {
                "conditions": [
                    {
                        "group": "AND",
                        "conditions": [
                            {
                                "property": "name",
                                "operator": "contains",
                                "value": "cha"
                            }
                        ]
                    }
                ]
            },
            "sort": "-updateTs",
            "returnCount": true,
            "view": "app-list"
        }

The search itself works fine but the returned entity’s view is wrong.

Ok, after reading the source code it seems that the parameter name is ‘viewName’ and not ‘view’. Now it works but is now inconsistent with get calls.

Hi,
it will be fixed in release 6.10

1 Like

Thanks for the fast resolution.

But putting this as a breaking change will hinder updates as I am calling this from my mobile app. Now updating to 6.10 will mean that all mobile users and the server code update at the exact same time which is impossible. Can’t we just deprecate it for now?

One way to go is to always call with both view and viewName from today onwards itself which is not so clean solution.

Thanks

You’re right. We’ll support both parameter names. Thanks.
The issue: https://github.com/cuba-platform/cuba/issues/1043

1 Like