which conveniently returns the right type. My question: can I rely on that, or am I missing a much more obvious option?
Not sure if this exact behavior is trustworthy - but you are on the right path. Place the value into either a json array or json object and then use the text versions of the accessor methods to get the json value to pass through the decoding routine.