notion-sdk-py
notion-sdk-py copied to clipboard
🐛 Boolean always evaluated to `True`
I'm trying to generate text with styling.
For example, if I want bold + italic text on a blue background, I do the following :
from notion_client import Client
text = {
"object": "block",
"type": "paragraph",
"paragraph": {
"text": [
{
"type": "text",
"text": {"content": "Test"},
"annotations": {
"bold": True,
"italic": True,
"strikethrough": False,
"underline": False,
"code": False,
"color": "blue_background",
},
}
]
},
}
notion = Client(auth=AUTH_TOKEN)
notion.blocks.children.append(block_id=BLOCK_ID, children=[text])
Expected result :
Actual result :
Every boolean annotations are set to True
, I don't know why...
It works properly if simply remove the annotations I want to set to False
:
text = {
"object": "block",
"type": "paragraph",
"paragraph": {
"text": [
{
"type": "text",
"text": {"content": "Test"},
"annotations": {
"bold": True, # Note : I can set this to False, the result is the same
"italic": True, # Note : I can set this to False, the result is the same
"color": "blue_background",
},
}
]
},
}
Hi @astariul, sorry for the long time to answer. Did you try calling the API with something else than notion-sdk-py (e.g. cURL) to check if the problem is on our side or Notion's?
Closing due to the lack of answer but if you still have the issue (or anyone else), feel free to comment and I'll reopen!