Skip to content
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

Rendering array in FAST produces incorrect JSON array #236

Open
leonseng opened this issue Nov 1, 2023 · 0 comments
Open

Rendering array in FAST produces incorrect JSON array #236

leonseng opened this issue Nov 1, 2023 · 0 comments

Comments

@leonseng
Copy link

leonseng commented Nov 1, 2023

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
          }
        ]
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant