alexa / alexa-apis-for-nodejs

The Alexa APIs for NodeJS consists of JS and Typescript definitions that represent the request and response JSON of Alexa services. These models act as core dependency for the Alexa Skills Kit NodeJS SDK (https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs).
Apache License 2.0
60 stars 35 forks source link

Add boolean type to the value of SetValueCommand #19

Closed ysak-y closed 2 years ago

ysak-y commented 3 years ago

What

Add boolean type to value property of SetValue.

Why

SetValue should set not only string type value but also boolean, number type value. For example, when I want to set the TouchWrapper 's disbaled to true, I can't. Because "false" string is evaluated as true in APL runtime.

https://developer.amazon.com/en-US/docs/alexa/alexa-presentation-language/apl-data-binding-syntax.html#truthy-and-coercion

Following document, TouchWrapper would be disabled even though I set disabled status to "false".

     {
        "type": "Container",
        "width": "100vw",
        "height": "100vh",
        "items": [
          {
            "type": "TouchWrapper",
            "bind": [
              {
                "name": "myText",
                "value": "Hello world"
              }
            ],
            "onMount": [
              {
                "type": "SetValue",
                "property": "disabled",
                "value": "false" <- Would be disabled because "false" is evaluated as true!!!!
              }
            ],
            "onPress": [
              {
                "type": "SetValue",
                "property": "myText",
                "value": "Hello world again"
              }
            ],
            "items": [
              {
                "type": "Text",
                "text": " ${myText}"
              }
            ]
          }
        ]
      }

So I want to deal boolean value in SetValue command.

How

Add boolean type to the value property of SetValueCommand

sjcomstock67 commented 2 years ago

LGTM. Any issues @Shreyas-vgr?

Shreyas-vgr commented 2 years ago

LGTM. Any issues @Shreyas-vgr?

Changes LGTM, but we autogenerate models from swagger specifications, hence we cannot merge this PR. We will incorporate this change and make a release soon!

Thanks for the PR @ysak-y