AdaptiveCards icon indicating copy to clipboard operation
AdaptiveCards copied to clipboard

Input.Toggle values are bool of type string

Open mrbrennonwilliams opened this issue 9 years ago • 3 comments

The values presented in the schema are that of type string for properties, value, valueOn and valueOff.

These should either be an enum field with additional values or strictly bool types.

mrbrennonwilliams avatar Oct 15 '17 11:10 mrbrennonwilliams

Hi there, do you mean something like this:

"Input.Toggle": {
      "additionalProperties": true,
      "type": "object",
      "description": "Input.Toggle collects a true/false response from the user",
      "allOf": [
        {
          "$ref": "#/definitions/CardElement"
        }
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Id for the value (will be used to identify collected input when SUBMIT is clicked)"
        },
        "title": {
          "type": "string",
          "description": "Title for the toggle"
        },
        "type": {
          "type": "string",
          "description": "Input.Toggle",
          "enum": [
            "Input.Toggle"
          ]
        },
        "value": {
          "type": "string",
          "description": "The current selected value",
          "default": "false",
          "enum": [
            "true",
            "false"
          ],
          "additionalProperties": true
        },
        "valueOff": {
          "type": "string",
          "description": "The value when toggle is off (default:false)",
          "enum": [
            "false"
          ],
          "additionalProperties": true
        },
        "valueOn": {
          "type": "string",
          "description": "The value when toggle is on (default:true)",
          "enum": [
            "true"
          ],
          "additionalProperties": true
        }
      },
      "required": [
        "id",
        "title"
      ]
    },

matthidinger avatar Oct 19 '17 18:10 matthidinger

Sorry Matt - I didn't mean that what is clearly a bool should be turned into an enum - what I mean is that if it string for a particular reason (you want to insert further values other than true and false) then the property type should be an enum. If not and it is planned to remain TRUE or FALSE - then it should be a type of bool as opposed to string.

mrbrennonwilliams avatar Oct 20 '17 00:10 mrbrennonwilliams

Closing as this is intentional that these properties are of type string

andrewleader avatar Jun 19 '19 22:06 andrewleader