JSONPath query

0 votes
asked Oct 23, 2023 in Question / help by Samuel Ramos
reshown Oct 23, 2023

Can I use a dynamic string to query JSON data like below?

!foreach $key in $files.spec
  entity $key.title {
    !$json_data = %load_json($path + "/" + $key.filename)

       ' JSONPath = $json_data.components.schemas.UserRegisterRequest.properties       !$dynamic_path = components.schemas.UserRegisterRequest.properties
        !$properties = $json_data[$dynamic_path]

    !foreach $property in %get_json_keys($properties)
     * $property
    !endfor
  }
!endfor

Thanks,

SR

1 Answer

0 votes
answered Mar 11 by dickmaley (4,120 points)

"Can I use a dynamic string to query JSON data like below?"

currently NO

...