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

How to access key in binding that contains '-' #1347

Closed
markussiebert opened this issue May 21, 2024 · 4 comments
Closed

How to access key in binding that contains '-' #1347

markussiebert opened this issue May 21, 2024 · 4 comments
Labels
question Further information is requested

Comments

@markussiebert
Copy link

Describe your question

I have values in a binding like:

{
  "resources": {
    "some-key": "some-value"
}}

and I want to access it like:

name: ($resolved_resources.resources.some-key)

in an assertion, but it does not work.

neither do
name: ($resolved_resources.resources[some-key])
or
name: ($resolved_resources.resources."some-key")

Any ideas?

chainsaw version Version

v0.1.0

Additional context

No response

@markussiebert markussiebert added the question Further information is requested label May 21, 2024
@eddycharly
Copy link
Member

I think $resolved_resources.resources."some-key" should be the correct syntax.

Can you post a simple example to reproduce the issue ?

@markussiebert
Copy link
Author

no, it isn't - chainsaw complains about. I switched to providing the values as array and do queries like:

 ($resolved_resources.resources[?compositionResourceName == 'someresource'].resourceName | [0])

@eddycharly
Copy link
Member

Ok, still if you have a simple example to reproduce i would be interested in seeing if this can be improved.

@eddycharly
Copy link
Member

Closing, not enough info to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants