That's a good idea.
It would help if you could post here some short snippets that would show simple examples.
Something like:
@startuml
!$myjson = {
"name": "Mark McGwire", "hr": 65, "avg": 0.278
}
!foreach $key in %get_json_keys($myjson)
rectangle $key
!endfor
@enduml
For function names, you can get inspired by other programming languages or library.
Thanks!