How can I provide a list of options as a dropdown in core.ask

Hello,
In my workflow, I’m trying to provide a list of options to the user to choose from in “core.ask” action. This list is a published variable from the previous task. How do I achieve this?

choose_target_state:
    action: core.ask
    input:
      schema:
        type: object
        properties:
          allowed_states:
           type: string
            description: "Target state"
            required: true
            enum:
              - with: 
                  items: <% ctx(target_states) %>

This does not seem to work. It causes the UI to crash/reload when the option is provided like this.

in the st2debug, this is what I see -

{“allowed_nss_states”: {“required”: true, “type”: “string”, “description”: “Target state”, “enum”: [{“with”: {“items”: [“InM”, “InP”, “InR”, “DR”, “D”, “InM”]}}]}}}}

Turns out it was quite simple, I just had to do it the following way -

enum: <% ctx(target_states) %>