From 3f9b8d34b43c4c39fe3fd58a5a43b90995cf42eb Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Fri, 26 Jul 2024 12:58:03 +0200 Subject: [PATCH 1/2] update json-search dependancy Signed-off-by: Matthias Gatto --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index a9b6cf2..c362812 100755 --- a/configure +++ b/configure @@ -35,7 +35,7 @@ EOF fi if [ "--wget-json-search" = $( echo "$arg" | cut -d '=' -f 1) ]; then rm json-search-x86_64.AppImage - wget https://github.com/cosmo-ray/json-search/releases/download/0.2/json-search-x86_64.AppImage + wget https://github.com/cosmo-ray/json-search/releases/download/0.3.1/json-search-x86_64.AppImage chmod +x json-search-x86_64.AppImage JSON_SEARCH="./json-search-x86_64.AppImage" elif [ "--list-api-versions" = $arg ]; then From a0fff1ead6eca8a7ec98240839a27f0e6b7fa6f6 Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Fri, 26 Jul 2024 14:36:03 +0200 Subject: [PATCH 2/2] fix broken array type parsing Signed-off-by: Matthias Gatto --- helper.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helper.sh b/helper.sh index 3c1fd52..801379e 100644 --- a/helper.sh +++ b/helper.sh @@ -47,9 +47,9 @@ get_type_direct() { elif [ "$sub_type" == 'null' ]; then local osub_ref=$(json-search -R '$ref' <<< ${arg_info}) local sub_ref=$(cut -d '/' -f 4 <<< $osub_ref 2> /dev/null) - local sub_ref_properties=$(jq $osub_ref.properties < osc-api.json 2> /dev/null) osub_ref=$(cut -c 2- <<< $osub_ref | sed 's|/|.|g') - if [ "$sub_ref_properties" == '' ]; then + local sub_ref_properties=$(jq $osub_ref.properties < osc-api.json 2> /dev/null) + if [ "$sub_ref_properties" == 'null' ] || [ "$sub_ref_properties" == '' ]; then local arg_info="$(jq $osub_ref < osc-api.json)" local dtypes=$(json-search $limit -R type 2> /dev/null <<< $arg_info) types="array $dtypes"