I'm writing descriptors for somebody else's pipeline steps jenkins plugin. Most steps are straight forward, e.g.
mySimpleStep(param1: value1, param2: value2)
However one of the steps requires a parameter, which is a map of two other values, so the actual call syntax is the following:
myOtherStep(param1: value1, param2: [sub1: value2, sub2: value3])
I can't fathom how to specify the parameters in the config.jelly file for the step and/or update the actual Step class so that the call syntax is created correctly. How can I do that?
(param2 class does have its own @DataBoundConstructor if it matter)
Do note that this is somebody else's plugin, I am in no position to change the actual plugin.
After almost giving up, I stumbled upon the answer while looking at the source code of Microsoft Azure Storage plugin. Here are the steps I needed to do.
Ensure that the class of
param2implementsStepand addDescriptioninner class to it. It also needs to have a@DataBoundConstructorCreate a separate descriptor directory for the class in resources with its own
config.jellyandhelp-*.htmlfilesChange the config.jelly of
myOtherStepto have something like this:Now the
config.jellyclass for the complex parameter will be included - and everything works as expected.