From 6b3cab8e8cf144cff22090f0bce2f54b05841031 Mon Sep 17 00:00:00 2001 From: Outscale Bot Date: Thu, 19 Oct 2023 15:14:22 +0200 Subject: [PATCH] handle oneOf in array items Signed-off-by: Outscale Bot --- hacks/patch-nooneof.rb | 5 +++++ hacks/patch.rb | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/hacks/patch-nooneof.rb b/hacks/patch-nooneof.rb index 3ac7694..c0d49b1 100755 --- a/hacks/patch-nooneof.rb +++ b/hacks/patch-nooneof.rb @@ -21,6 +21,11 @@ arg_info[key] = val end arg_info.delete("oneOf") + elsif arg_info.key?("items") and arg_info["items"].key?("oneOf") then + arg_info["items"]["oneOf"][0].each do |key, val| + arg_info["items"] = val + end + arg_info["items"].delete("oneOf") end end end diff --git a/hacks/patch.rb b/hacks/patch.rb index 1d00029..e4b7bce 100755 --- a/hacks/patch.rb +++ b/hacks/patch.rb @@ -24,6 +24,11 @@ arg_info[key] = val end arg_info.delete("oneOf") + elsif arg_info.key?("items") and arg_info["items"].key?("oneOf") then + arg_info["items"]["oneOf"][0].each do |key, val| + arg_info["items"] = val + end + arg_info["items"].delete("oneOf") end if old_schema.key?(call_name) then old_arg_prop = old_schema[call_name]["properties"]