bachya / aiopinboard

A Python 3, asyncio-based library to interact with the Pinboard API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Only the last tag is saved when providing a list of tags

davep opened this issue · comments

Describe the bug
When a list of tags is supplied to the API, only the last tag gets saved.

To Reproduce
Run the following code, adding a suitable API token for the value of TOKEN:

from asyncio import run
from datetime import datetime
from aiopinboard import API

TOKEN = "<token here>"

async def show_problem():
    await API(TOKEN).bookmark.async_add_bookmark(
        url=f"https://www.example.com/{datetime.now().isoformat()}",
        title=f"Test {datetime.now().isoformat()}",
        description=f"Test {datetime.now().isoformat()}",
        tags=["foo", "bar", "baz"],
        shared=False,
        toread=True,
        replace=True,
    )

if __name__ == "__main__":
    run(show_problem())

Expected behavior
We would expect the resulting bookmark on pinboard.io to have all 3 tags.

Screenshots
Screenshot 2023-12-13 at 09 41 07