Skip to content

Next page token presence does not behave as documented #188

@radiozradioz

Description

@radiozradioz

Describe the bug

The documentation says this:

| nextPageToken | string | A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. | No |

When I make a ListMemos request that will have no next page, e.g. curl https://memos.example.com/api/v2/memos?pageSize=50&filter=row_status%20%3D%3D%20'NORMAL' , the returned page token is an empty string rather than being absent:

{..."resources":[], "relations":[], "reactions":[]}], "nextPageToken":""}

The documentation implies that the field will be absent. This is incongruent.

Personally I think the fix should either be ommitting the field or setting it to null when there is no extra page. Empty string is not an acceptable stand-in for null.

Steps to reproduce

Run a ListMemos query with a page size that is higher than the number of memos in your instance.

The version of Memos you're using

v0.24.1

Screenshots or additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions