adamkewley / jobson

A platform for transforming command-line applications into a job service.
Apache License 2.0
256 stars 20 forks source link

string[] outputs java object #6

Closed michaelluich closed 6 years ago

michaelluich commented 6 years ago

In my spec:

expectedInputs:

arguments:

This is what I get in the python script I call. I would expect some sort of text. '--ldapGroups': 'com.github.jobson.jobinputs.stringarray.StringArrayInput@c003911f',

adamkewley commented 6 years ago

I agree, the output is poor. We don't personally use the feature in production, which is why it doesn't exist - but it should.

I just patched jobson-0.0.8 with a join function that lets you write:

${join(",", inputs["ldapGroups"])}
${join(",", inputs.ldapGroups)}

The patch also makes the default string representation of a string array input into a comma-delimited list of the array's inputs, so if you use the bare identifier (in your case, ldapGroups) then it will default to producing the same result as the above. Explicitly using the join function allows you to customize the delimiter to your liking (and being explicit can be a good thing).

The commit above (afbb42a) shows all the code-based changes. These won't affect you directly, but do contain a few examples of usage in the tests.

michaelluich commented 6 years ago

The basic use case works fine.

I have not tested the join function.

Thanks.

On Thu, Feb 1, 2018 at 8:13 AM, Adam Kewley notifications@github.com wrote:

I agree the output is poor. We don't personally use the feature in production, which is why it doesn't exist - but it should.

I just patched jobson-0.0.8 with a join function that lets you write:

${join(",", inputs["ldapGroups"])} ${join(",", inputs.ldapGroups)}

The patch also makes the default string representation of a string array input into a comma-delimited list of the array's inputs, so if you use the bare identifier (in your case, ldapGroups) then it will default to producing the same result as the above. Explicitly using the join function allows you to customize the delimiter to your liking (and being explicit can be a good thing).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adamkewley/jobson/issues/6#issuecomment-362261875, or mute the thread https://github.com/notifications/unsubscribe-auth/AQ6LBL4h1WIOAaChiMFDKLAX6c5Q8pjyks5tQbiFgaJpZM4R01-U .

-- http://www.actifio.com/ Michael Luich Senior Devops Engineer e michael.luich@actifio.com c 7817907586 t @actifio http://twitter.com/actifio Access your enterprise data as a service, instantly anywhere.