taskflow icon indicating copy to clipboard operation
taskflow copied to clipboard

REST API shows different structure for one endpoint

Open timwis opened this issue 8 years ago • 1 comments

/tasks, /workflows and /workflow-instances shows a structure like this:

{
    "total_pages": 1,
    "page": 1,
    "count": 26,
    "data": [
        { ... }
    ]
}

But /workflow-instances/recurring-latest doesn't have that structure and just shows the data array:

[
     { ... }
]

Not sure if this is intentional or not. One way I've seen around returning pagination details in the body (and having to wrap the actual body) is to do it in the response headers.

timwis avatar Sep 01 '17 11:09 timwis

@timwis /workflow-instances/recurring-latest does not paginate

Something that may make it more consistent is to return:

{
    "count": 26,
    "data": [
        { ... }
    ]
}

Keeps a more simpler structure without making it seem paginated

awm33 avatar Sep 01 '17 19:09 awm33

Yep, or putting the count/page/total values in response headers and just keeping the body as the data.

timwis avatar Sep 01 '17 21:09 timwis