JSON Config Variables Arrays

I’m trying to use the JSON Configuration Variables feature and it seems that arrays are not supported. This would be a handy feature to have.

For example, including nested arrays:

{
	"test1": "foo",
	"test2": [ "bar" ],
        "test3" : [
             "test4": "baz",
             "test5": [
                "a",
                "b"
                ]
        ]
}

The ASP.NET JSON configuration supports references like x:0:y so perhaps this could be implemented through variables like test2:0 = bar or test3:test5:0 = a.

Hi!

Thanks for getting in touch. I’ve added this GitHub Issue as an enhancement and we will consider shipping array support as part of our support for ASP.NET Core 1.0.

Hope that helps!
Mike

Thank you Mike.

Hi!
I am glad JSON configuration variable feature on Octopus Deploy now supports arrays.
But I searched everywhere for an example and can’t find one. How would this Json array look like as variables:

“seasons”: [
{
“id”: “201705”,
“name”: “5-2017”,
“legacy”: false
},
{
“id”: “201604”,
“name”: “4-2016”,
“legacy”: true
},
{
“id”: “201603”,
“name”: “3-2016”,
“legacy”: true
}
]

Hi!

Thanks for getting in touch. My esteemed colleague Mark Rydstrom added some examples: http://docs.octopusdeploy.com/display/OD/JSON+Configuration+Variables+Feature

Hope that helps!
Mike

Whilst the examples are helpful. What is missing is an example of an array of objects.

Hi Matthew,

I’ve updated our doc page with some more detailed examples: http://docs.octopusdeploy.com/display/OD/JSON+Configuration+Variables+Feature

However I haven’t added anything dealing with arrays of objects. What were you specifically referring to? Do you want to:

  1. Update a value nested deeply in an object belonging to an array? Something like myArray:3:myObject:myProperty = myValue
  2. Update an entire object in the array? Something like myArray:3 = {"myObject":{"myProperty":"myValue"}}

Hope that helps!
Mike