Skip to content

Conversation

arbourd
Copy link
Owner

@arbourd arbourd commented Apr 14, 2023

This resource used a chain of query params that looked like vars.key="value", that were originally sourced from JSON. We can also pass vars in as ?vars={"key":"value"} with a JSON string directly, without having to parse the JSON and then reconstruct.

This means, we easily allow nested JSON, arrays or any other type we are currently not handling by just passing the JSON string from the Concourse itself and feeding it back into the URL.

Closes #105

This resource used a chain of query params that looked like
`vars.key="value"`, that were originally sourced from JSON.

We can also pass vars in as `?vars={"key":"value"}` with JSON directly.

This means, we easily allow nested JSON, arrays or any other type we
are currently not handling by just passing the JSON string from the
Concourse itself and feeding it back into the URL.
@arbourd arbourd force-pushed the use-json-for-vars branch from 86053fd to 89ed070 Compare April 14, 2023 17:05
Copy link
Collaborator

@smoke smoke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a very good approach and implementation!
I was looking to do the same thing!

@arbourd arbourd merged commit e382962 into main Apr 17, 2023
@arbourd arbourd deleted the use-json-for-vars branch April 17, 2023 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instance vars with an array panics the resource
2 participants