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

"additional_parameters" section only contains first item listed #14

Closed
strimber opened this issue Mar 19, 2018 · 1 comment
Closed

"additional_parameters" section only contains first item listed #14

strimber opened this issue Mar 19, 2018 · 1 comment

Comments

@strimber
Copy link

strimber commented Mar 19, 2018

When we execute the following line (153) from out:

read -r -a props_kv_arr <<< "$(jq -r 'to_entries|map("(.key)="(.value|tostring)"")|.[]' <<< "${additional_properties}")"

The props_ky_arr only contains the first value "param.foo: bar"
we would expect all additional properties to be appended to the -Dparameter list...

possible solution:
read -d ‘,’ -r -a props_kv_arr <<< “$(jq -r ‘to_entries|map(“(.key)=\“(.value|tostring)\“”)|.[]’ <<< “${additional_properties}“)”
-d to specify the delimiter which is comma (,) in this case

sample input json:

{
“params”: {
“project_path”: “cli_project”,
“project_key”: “com.example.cli_project”,
“sources”: [
“src1”,
“src2"
],
“additional_properties”: {
“param.foo”: “bar”,
“param1.foo1": “bar1”
}
},
“source”: {
“host_url”: “https://sonar.example.com/“,
“login”: “$$ACCESS_TOKEN$$”
}
}

@headcr4sh
Copy link
Member

Ouch. Probably I bug that has been introduced by my (very) limited knowledge of the jq parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants