For an add-on I am developing, I would like to add an array (or list?) of n elements to the options in the config to configure additional hosts.
I am following the structure given in the example with the logins, but changed it to additional_hosts (see here for my full config):
Now this works fine for testing and developing. In the final version, I want to make the whole additional_hosts array optional though, so the user does not have to define any additional hosts in the config. I tried simply removing the additional_hosts array from the options section and just leave it in the schema. Since the hostname and service are optional there, I thought this might work. Nevertheless, I cannot save the config since it is missing an entry for additional_hosts.
Does anyone have an idea on how to make this array optional?
Thanks for your reply. I think you are partly correct: Options are what is visible to the user by being added to the options as a standard. This will lead to the option fields being visible in the Configuration section of the add-on. Nevertheless, you can also configure optional parameters by just defining them in the Schema section and add a ? behind the data type. You can see that in this example with the not_needed parameter.
In the Add-On Configuration tab, those options are then hidden and only shown once you activate the Show unused optional configuration options flag.
So what I want to do is exactly that, but with an array and not just a simple string.