Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

REST API shows different structure for one endpoint #17

Open
timwis opened this issue Sep 1, 2017 · 2 comments
Open

REST API shows different structure for one endpoint #17

timwis opened this issue Sep 1, 2017 · 2 comments

Comments

@timwis
Copy link
Contributor

timwis commented Sep 1, 2017

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

@awm33
Copy link
Contributor

awm33 commented Sep 1, 2017

@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

@timwis
Copy link
Contributor Author

timwis commented Sep 1, 2017

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

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

No branches or pull requests

2 participants