Parsing JSON array with only values

Hello everyone,

Here's a simple problem, but one I can't find a solution for:
From this array

{
    "genre": [
        "Hip-Hop/Rap",
        "Music",
        "Hip-Hop",
        "Hardcore Rap"
    ]
}

How can I extract all genre values?
Ideally, the correct command to use would be json_select_many "array" "object" s s n n, but since there is no key on each value, what would make sense would be json_select_many "array" "" s s n n. But this doesn't work; or rather, returns [empty]

I've also tried

(...)
json_foreach "genre"
	OutputTo "integer"
	json_foreach_counter
	json_select_array "genre" "%integer%"
	OutputTo "testOutput"
	SayRest
	Set "%integer%"
json_foreach_end

This should assign 1~4 to %integer% and then use json_select_array "genre" "1~4" to get the values; but this returns an error on json_select_array "genre" "%integer%" because %integer% is interpreted as a string and not as a number, which breaks the command.

This test data is a valid JSON array, as per validation by jsonlint.com.
So what am I missing?

Thank you in advance.

Well, this does work..... But if I needed to process each value independently (with an If condition, for example), I would need to work with the string generated from that array, and not the array itself.

Using json_select_array "genre" -1 "," I would get the following string:

Hip-Hop/Rap,Music,Hip-Hop,Hardcore Rap

If I wanted to loop through each value, and apply a condition only if the "Music" genre were present, I could do

(...)
RegexpReplace "^.*" ",${0}"
Do
	MoveChar 1
	If "Music"
		SayUntil ","	--> or something else
	EndIf
	FindInLine "," 1 1
	MoveChar -1
While ","

which works perfectly fine for "Music", but would cause trouble for "Hip-Hop", because there would be 2 matches. This can be negated by using If "Hip-Hop," instead, because now the If condition would match the entire value until the delimiter (for comma-separated values, in this example).

Now, the same process, with the same raw data BUT with key--value pairs:

{
    "genre": [
        {"key": "Hip-Hop/Rap"},
        {"key": "Music"},
        {"key": "Hip-Hop"},
        {"key": "Hardcore Rap"}
    ]
}

To apply a condition if "Hip-Hop" is present:

json_foreach "genre"
	json_select "key"
	If "Hip-Hop"
		(...)		--> do something
	EndIf
json_foreach_end

Which is much simpler.

Other than json_select_array, which will -depending on the modifiers- return the nth value of an array, or return all elements from the array in a string -which will then require further processing-, I can't find a way to work with all the elements in a JSON array, one by one, in a loop, if said array does not contain keys, and while benefiting from the JSON format of the raw data (that is, enabling the use of JSON related commands).

I hope this time I was able to convey more clearly what I'm hoping to achieve.