@@ -206,8 +206,11 @@ function kuber_type(ctx::KuberContext, T, j::Dict{String,Any})
206
206
T
207
207
end
208
208
209
- kuber_obj (ctx:: KuberContext , data:: String ) = kuber_obj (ctx, JSON. parse (data))
210
- kuber_obj (ctx:: KuberContext , j:: Dict{String,Any} ) = convert (kind_to_type (ctx, j[" kind" ], get (j, " apiVersion" , nothing )), j)
209
+ # OpenAPI conversions insist that JSONs objects are always `Dict{String,Any}`.
210
+ # To ensure that for a user supplied Dict, we serialize that to string and parse it back as json.
211
+ kuber_obj (ctx:: KuberContext , j:: Dict{String,Any} ) = kuber_obj (ctx, JSON. json (j))
212
+ kuber_obj (ctx:: KuberContext , data:: String ) = _kuber_obj (ctx, JSON. parse (data))
213
+ _kuber_obj (ctx:: KuberContext , j:: Dict{String,Any} ) = convert (kind_to_type (ctx, j[" kind" ], get (j, " apiVersion" , nothing )), j)
211
214
212
215
show (io:: IO , ctx:: KuberContext ) = print (io, " Kubernetes namespace " , ctx. namespace, " at " , ctx. client. root)
213
216
@@ -235,10 +238,11 @@ function set_server(
235
238
reset_api_versions:: Bool = false ;
236
239
max_tries= retries (ctx, false ),
237
240
verbose:: Bool = false ,
241
+ debug:: Bool = false ,
238
242
kwargs...
239
243
)
240
244
rtfn = (return_types,response_code,response_data)-> kuber_type (ctx, return_types, response_code, response_data)
241
- ctx. client = OpenAPI. Clients. Client (uri; get_return_type= rtfn, kwargs... )
245
+ ctx. client = OpenAPI. Clients. Client (uri; get_return_type= rtfn, verbose = debug, kwargs... )
242
246
ctx. client. headers[" Connection" ] = " close"
243
247
reset_api_versions && set_api_versions! (
244
248
ctx;
453
457
454
458
# Add validations for the k8s spec specific int-or-string format
455
459
OpenAPI. val_format (val:: Union{AbstractString,Integer} , :: Val{Symbol("int-or-string")} ) = true
456
- OpenAPI. val_format (val, :: Val{Symbol("int-or-string")} ) = false
460
+ OpenAPI. val_format (val, :: Val{Symbol("int-or-string")} ) = false
0 commit comments