-
Notifications
You must be signed in to change notification settings - Fork 152
'isSubtle' and possibly other boolean cards properties are not handled properly #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for raising this @acilate. Will have a look into it. |
Where are you on a fix for this? This is major bug, module not usable. |
@edkuse I hope to have a fix in by the start of the next week. Thanks for your patience. |
I just pushed a change that should resolve this issue. A card like this: from webexteamssdk.models.cards import AdaptiveCard
from webexteamssdk.models.cards.components import TextBlock
from webexteamssdk.models.cards.options import HorizontalAlignment
from webexteamssdk.models.cards.actions import Submit
t = TextBlock("Test text", isSubtle=True, horizontalAlignment=HorizontalAlignment.CENTER)
body = []
body.append(t)
s = Submit(title="Test", data={"hidden": "data"})
actions = [s]
c = AdaptiveCard(body=body, actions=actions)
print(str(c.to_json(indent=4))) now prints as this (valid) json {
"version": "1.1",
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Test text",
"horizontalAlignment": "center",
"isSubtle": true
}
],
"actions": [
{
"data": {
"hidden": "data"
},
"title": "Test",
"type": "Action.Submit"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
} You can try the code by installing my development branch (pip3 install git+https://github.com/sQu4rks/webexteamssdk@issue-107) or wait until the PR gets merged and a new release gets pushed. Let me know if this resolves your issue. |
Fixed simple property rendering (fixes #107)
Uh oh!
There was an error while loading. Please reload this page.
The 'isSubtle' property on a card TextBlock element, when set to True, is sent as a JSON sting value "True" which is not valid. It must be a boolean value.
The text was updated successfully, but these errors were encountered: