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

Improve concat to accept numeric values #6911

Open
anderseknert opened this issue Aug 5, 2024 · 5 comments
Open

Improve concat to accept numeric values #6911

anderseknert opened this issue Aug 5, 2024 · 5 comments
Assignees

Comments

@anderseknert
Copy link
Member

When trying to build JSON paths from an array of strings and numbers, concat will fail:

r := concat("/", ["path", 0, "foo"])
1 error occurred: policy.rego:5: rego_type_error: concat: invalid argument(s)
	have: (string, array<string, number, string>, ???)
	want: (delimiter: string, collection: any<array[string], set[string]>, output: string)

We can of course work around this by first converting all numbers in the array to strings, but it would be more convenient if concat treated numbers as strings in the first place. I can't think of any reason it shouldn't.

@sunjh
Copy link

sunjh commented Aug 16, 2024

Please assign to me, I can work on this, thanks!

@sunjh
Copy link

sunjh commented Sep 2, 2024

Working in progress. Will create pull request after the internal PR review.

@sunjh
Copy link

sunjh commented Sep 23, 2024

Hi @anderseknert , the change is ready, but when I try to create a PR, it says I must be a collaborator. Do you know what should I do to open this PR?

@anderseknert
Copy link
Member Author

You have to first fork OPA, then submit the PR from your fork

@srenatus
Copy link
Contributor

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks

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

3 participants