Skip to content

Rendering array in FAST produces incorrect JSON array #236

@leonseng

Description

@leonseng

Version: v3.15.0

Rendering "serverAddresses": {{server_addresses::array}} in FAST using Render Fast Template HTML Preview results in "serverAddresses": 10.1.20.10,10.1.20.11 - missing square brackets and double quotes

Expected result: "serverAddresses": ["10.1.20.10","10.1.20.11"]

image

Sample FAST

title: Simple HTTP Application
description: Simple HTTP load balancer using the same port on client and server side.
parameters:
  tenant_name: tophttp
  application_name: defaultsHTTP_8080
  virtual_address: 10.0.0.200
  virtual_port: 8080
  server_addresses:
    - 10.1.20.10
    - 10.1.20.11
  service_port: 80
template: |
  {
    "class": "ADC",
    "schemaVersion": "3.20.0",
    "{{tenant_name}}": {
      "class": "Tenant",
      "{{application_name}}": {
        "class": "Application",
        "template": "http",
        "serviceMain": {
          "class": "Service_HTTP",
          "virtualAddresses": [
            "{{virtual_address}}"
          ],
          "virtualPort": {{virtual_port}},
          "pool": "{{application_name}}_Pool1"
        },
        "{{application_name}}_Pool1": {
          "class": "Pool",
          "monitors": [
            "icmp"
          ],
          "members": [
            {
              "serverAddresses": {{server_addresses::array}},
              "servicePort": {{service_port}}
            }
          ]
        }
      }
    }
  }

Resulting AS3 JSON

{
  "class": "ADC",
  "schemaVersion": "3.20.0",
  "tophttp": {
    "class": "Tenant",
    "defaultsHTTP_8080": {
      "class": "Application",
      "template": "http",
      "serviceMain": {
        "class": "Service_HTTP",
        "virtualAddresses": [
          "10.0.0.200"
        ],
        "virtualPort": 8080,
        "pool": "defaultsHTTP_8080_Pool1"
      },
      "defaultsHTTP_8080_Pool1": {
        "class": "Pool",
        "monitors": [
          "icmp"
        ],
        "members": [
          {
            "serverAddresses": 10.1.20.10,10.1.20.11,
            "servicePort": 80
          }
        ]
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions